Type Error on Event Type payment_intent webhook (#55493)

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_'
This commit is contained in:
Alejandro Roigé 2023-09-18 22:15:42 +02:00 committed by GitHub
parent 41c89f0cd8
commit 4c6d4b35b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ export async function POST(req: Request) {
data = event.data.object as Stripe.Checkout.Session data = event.data.object as Stripe.Checkout.Session
console.log(`💰 CheckoutSession status: ${data.payment_status}`) console.log(`💰 CheckoutSession status: ${data.payment_status}`)
break break
case 'payment_intent.failed': case 'payment_intent.payment_failed':
data = event.data.object as Stripe.PaymentIntent data = event.data.object as Stripe.PaymentIntent
console.log(`❌ Payment failed: ${data.last_payment_error?.message}`) console.log(`❌ Payment failed: ${data.last_payment_error?.message}`)
break break