Skip to content

Commit 81929f0

Browse files
committed
test
1 parent 437174f commit 81929f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

services/WebhookService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const getNotificationEngine = (): NotificationEngine => {
1313
}
1414

1515
const handleCheckoutSessionCompleted = async (session: Stripe.Checkout.Session): Promise<void> => {
16-
const customer = session.customer as Stripe.Customer
17-
console.log('customer', customer)
18-
const customerId = customer.id
16+
const customerId = session.customer as string
1917
const userId = session.client_reference_id || session.metadata?.user_id
2018
const productId = session.metadata?.product_id
2119

@@ -107,6 +105,7 @@ const handleCheckoutSessionCompleted = async (session: Stripe.Checkout.Session):
107105

108106

109107
const handleSubscriptionUpdated = async (subscription: Stripe.Subscription): Promise<void> => {
108+
console.log('subscription', subscription)
110109
// Check if subscription was just marked for cancellation
111110
if (subscription.cancel_at_period_end) {
112111
console.log(`Subscription ${subscription.id} marked for cancellation at period end`)
@@ -145,6 +144,7 @@ const handleSubscriptionUpdated = async (subscription: Stripe.Subscription): Pro
145144
}
146145

147146
const handleSubscriptionDeleted = async (subscription: Stripe.Subscription): Promise<void> => {
147+
console.log('subscription', subscription)
148148
const updatedLicense = await LicenseRepo.updateLicenseByStripePaymentId(subscription.id, 'expired')
149149

150150
if (!updatedLicense) {

0 commit comments

Comments
 (0)