#Gavin - payment intent events
1 messages · Page 1 of 1 (latest)
You will want to use our test cards for successful and unsuccessful payments https://stripe.com/docs/testing
Have you already been trying something like that or does that sound like the missing piece?
Is there a place in this test you are getting stuck?
Or are you doing this successfully and not seeing the event?
I am using the code from here: https://stripe.com/docs/payments/payment-intents/verifying-status#webhooks
$event->type is being returned to me as payment_intent.created
Do you have a payment intent ID (pi_123) from a time you tried this?
I can try it again & log the intent ID to see what it is.
event type: payment_intent.created
intent ID: pi_3KO7aEEmnddknpef0NRhtEBI
There is also an event for the payment succeeding https://dashboard.stripe.com/test/events/evt_3KO7aEEmnddknpef0XKvq0Dc
And it was successfully sent to a webhook that you have set up. Did you see that in your event handler code?
ahhhh ok I found the issue. It was a mistake on my part in the code.
When I had set up to log the event, it would overwrite the previously logged events
Ah nice catch!
One last question while I'm here.
I see that two events were triggered that seem similar.
invoice.payment_succeeded
payment_intent.succeeded
Would payment_intent.succeeded be for that sessions payment, and then subsequent subscription charges would come as invoice.payment_succeeded? orrrr not?
I'm sure it's prob in the docs somewhere if I look, just figured you may know right off
mostly yes. Invoices are built on top of PaymentIntents. When an Invoice is paid, the underlying PaymentIntent is paid too so you get both events