#Atish

1 messages · Page 1 of 1 (latest)

zinc garnetBOT
whole aurora
#

If you have an existing Webhook, you can update it to listen to those Checkout Session events

jagged fractal
#

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?

whole aurora
#

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

jagged fractal
#

checkout.session.completed doesn't guarantee successful payment right?

whole aurora
#

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

jagged fractal
#

async payment method is related to something else or?

whole aurora
#

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

jagged fractal
#

I need to listen to both type of events then

jagged fractal
# jagged fractal

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!!
        )```
whole aurora
jagged fractal
#

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?

whole aurora
#

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

jagged fractal
#

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?

whole aurora
#

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

jagged fractal
whole aurora
#

If you set metadata during Checkout Session, you don't have to query it. metadata will be present in checkout.session.* events