Skip to content

Commit

Permalink
Type Error on Event Type payment_intent webhook (#55493)
Browse files Browse the repository at this point in the history
changed` failed `for `payment_failed` on line 45

### What?
Error in line 45 on type of payment_intent

### Why?
Example provided does not work 

### How?
Added 'payment_'
  • Loading branch information
roigecode authored Sep 18, 2023
1 parent 41c89f0 commit 4c6d4b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/with-stripe-typescript/app/api/webhooks/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function POST(req: Request) {
data = event.data.object as Stripe.Checkout.Session
console.log(`💰 CheckoutSession status: ${data.payment_status}`)
break
case 'payment_intent.failed':
case 'payment_intent.payment_failed':
data = event.data.object as Stripe.PaymentIntent
console.log(`❌ Payment failed: ${data.last_payment_error?.message}`)
break
Expand Down

0 comments on commit 4c6d4b3

Please sign in to comment.