mirror of
https://github.com/vernu/textbee.git
synced 2026-05-25 00:44:15 -04:00
fxi(api): fix polar webhook issue
This commit is contained in:
@@ -49,10 +49,11 @@ export class BillingController {
|
||||
// Handle Polar.sh webhook events
|
||||
switch (payload.type) {
|
||||
case 'subscription.created':
|
||||
case 'subscription.active':
|
||||
console.log('polar subscription.created')
|
||||
console.log(payload)
|
||||
await this.billingService.switchPlan({
|
||||
userId: payload.data.customerId,
|
||||
userId: payload.data?.metadata?.userId as string,
|
||||
newPlanName: payload.data?.product?.name?.split(' ')[payload.data?.product?.name?.length - 1] || 'pro',
|
||||
newPlanPolarProductId: payload.data?.product?.id,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user