We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4863aed commit 79ea379Copy full SHA for 79ea379
1 file changed
packages/console/app/src/routes/stripe/webhook.ts
@@ -226,7 +226,7 @@ export async function POST(input: APIEvent) {
226
expand: ["discounts", "payments"],
227
})
228
const paymentID = invoice.payments?.data[0]?.payment.payment_intent as string
229
- const couponID = (invoice.discounts[0] as Stripe.Discount).coupon?.id as string
+ const couponID = (invoice.discounts[0] as Stripe.Discount)?.coupon?.id as string
230
if (!paymentID) {
231
// payment id can be undefined when using coupon
232
if (!couponID) throw new Error("Payment ID not found")
0 commit comments