This commit is contained in:
Frank
2026-06-08 01:31:31 -04:00
parent 5961c7384f
commit 76bf2847d6
@@ -226,7 +226,7 @@ export async function POST(input: APIEvent) {
expand: ["discounts", "payments"],
})
const paymentID = invoice.payments?.data[0]?.payment.payment_intent as string
const couponID = (invoice.discounts[0] as Stripe.Discount).coupon?.id as string
const couponID = (invoice.discounts[0] as Stripe.Discount)?.coupon?.id as string
if (!paymentID) {
// payment id can be undefined when using coupon
if (!couponID) throw new Error("Payment ID not found")