mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 04:48:32 +00:00
zen: fix
This commit is contained in:
parent
4863aedf3d
commit
79ea379df2
1 changed files with 1 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue