#rawaha-anik_webhooks

1 messages · Page 1 of 1 (latest)

mystic locustBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1384045650941054978

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

regal oracle
#

Hello,

We are currently in the process of integrating Stripe into our system. During this integration, we’ve encountered a particular issue. When a customer attempts to make a payment using an invalid card, an expired card, or a card with insufficient funds, the payment_intent.failed event is triggered by Stripe.

On our side, each time we create a checkout session, we also create a corresponding payment object in our system. We track and update the state of this payment object based on the Stripe events we receive. Specifically:

If the payment is successful, we mark the payment state as "Succeeded".
If the payment fails, we mark it as "Failed".
If the checkout session expires, we mark it as "Expired".
In both the failed and expired scenarios, we treat the payment attempt as unsuccessful and prompt the customer to initiate a new checkout session.

The challenge we’re facing is that even after a payment has failed or expired on our end, the previous Stripe Checkout Sessions remain active. As a result, customers are sometimes able to attempt payment multiple times using the previous checkout sessions for a single order.

We would like to better understand how such scenarios are typically handled and whether there are recommended practices to prevent customers from retrying payments on outdated or failed checkout sessions.

Currently, we are listening to the following Stripe events to update our payment states:

  1. payment_intent.succeeded
  2. payment_intent.failed
  3. payment_intent.canceled
  4. checkout_session.expired
white holly
#

It's expected. A PaymentIntent is generated from a Checkout Session, but the CheckoutSession can still be active after one "intent" failed

#

even after a payment has failed or expired on our end, the previous Stripe Checkout Sessions remain active
This is a bit unclear. The Payment has failed but the previous Checkout Sessions is still active and not expired?

regal oracle
#

Yes. The previous checkout session is still active.

white holly
#

So the PaymentIntent is failed, but CS isn't expired yet. I believe this is expected. You could just let your customer to try the CheckoutSession again

regal oracle
#

Can you suggest me any best practices?
I mean there are other systems as well who has integrated with stripe.
How stripe suggests to handle this?

Also I would like to know, for which reasons "payment_intent.failed" event is triggered?
Apart from using invalid cards.

white holly
#

There could be various reasons, all depends on the issuer bank. Issuer bank can decide to decline a transaction if their system has a fraud engine, or they are under a new regulation, etc... You would want to look at the reason of failed charge to (probably) see more info

#

For suggesting best practice, wouldn't it be just notifying your customer for retrying the same Checkout Session, until the Checkout Session's expiration?

#

You know the expiration time from Checkout Session object

mystic locustBOT