#Atish
1 messages · Page 1 of 1 (latest)
You can set it up in the Dashboard when creating the Webhook endpoint: https://dashboard.stripe.com/test/webhooks/create
If you have an existing Webhook, you can update it to listen to those Checkout Session events
Hi river, I just created a checkout session and completed a payment. I dont see events like checkout.session.async_payment_succeeded. Can you help with these?
Here payment_intent.succeeded means the payment has been completed successfully? What does the last payment_intent.created mean?
From your logs, I can see checkout.session.completed was delivered to your Webhook endpoint
Only one of those three events will be sent upon attempting the payment on Checkout Session
checkout.session.completed doesn't guarantee successful payment right?
checkout.session.completed event guarantees successful payment
Only when async payment method is used, then checkout.session.async_payment_succeeded will be sent
It's either checkout.session.completed or checkout.session.async_payment_succeeded event
async payment method is related to something else or?
Got it, thank you
Some payment methods such as bank transfer will take longer time to process and it's not synchronous. Stripe will then inform you later time when the payment is completed
So this will be informed through checkout.session.async_payment_succeeded, right?
I need to listen to both type of events then
Also will you please explain last two events payment_intent.succeeded and payment_intent.created?
"https://example.com/return",
"https://example.com/return",
request.currency,
(request.amount * 100).roundToLong(),
request.name,
(request.amount * 20).roundToLong(),
owner.stripeAccountId!!
)```
Payment Intent is the underlying object used for Checkout Session. If you use Checkout Session, checkout.session.* events should be sufficient: https://stripe.com/docs/payments/checkout/fulfill-orders#delayed-notification
I am creating a checkout session and getting the paymentUrl. The user will go to the paymentUrl and pay for it. After successful payment I will receive checkout.session.completed or checkout.session.async_payment_succeeded event. How can I identify for which checkout session is this event? Am I missing something?
You don't have to identify which event will be sent. If the payment is successful, one of them will be sent. You only need to ensure your system receives one of them
Sorry if I am not being able to clear my question. I need to map my checkout sessions with the completed payments.
<com.stripe.model.Event@1848162320 id=evt_1MfwOJDfJAkpzIQTpgx98ldi> JSON: {
"account": null,
"api_version": null,
"created": 1677464679,
"data": {
"previous_attributes": null,
"object": {}
},
"id": "evt_1MfwOJDfJAkpzIQTpgx98ldi",
"livemode": false,
"object": "event",
"pending_webhooks": null,
"request": {
"id": null,
"idempotency_key": null
},
"type": "checkout.session.completed"
}
I need to identify for which purchase is this checkout.session.completed?
When you create a Checkout Session, you can store your order number and its Checkout Session ID in the database. When the checkout session event is sent, you can map back to your order number and identify which order this payment belongs to
Alternatively, you can set your own reference in the metadata of Checkout Session which you can reference it in the event: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I need to query again for the "id": "evt_1MfwOJDfJAkpzIQTpgx98ldi",?
If you set metadata during Checkout Session, you don't have to query it. metadata will be present in checkout.session.* events