I have a question to ask about payment strategy with Stripe Checkout API. consider following scenario
I am trying to integrate Stripe payment gateway to my marketplace platform and I could not find a solution for this kind of scenario.
Is there any feature in Stripe to handle this ? Like session timeout period ? Or What is the standard way to handle this ?
Appreciate your help.
With Stripe, delayed payments are enabled by default. This has a few effects: it is not possible for buyers to select an end date that is more than 85 days in the future in an availability listing using one of the calendars. funds can't be held for longer than 90 days.
This waiting period can be up to 14 days for businesses in certain industries. This delay allows Stripe to mitigate some of the risks inherent in providing credit services. You can confirm your payout schedule and estimated payout timing in your Dashboard.
There are three ways you can increase authorization rates with Stripe: Adaptive Acceptance, Smart Retries, and card account updater.
I don't know if this is still relevant!
But I had the same problem before. What I did is I start managing the sessions from the application side. So I have a stripe sessions table and I have a timeout, and status of the session. Also, I have a purchase table with a status that could be pending if the user didn't pay yet. So I can update the items counts in the real store.
This is the scenario I have implemented. It might help you or anyone who is thinking of this problem. Maybe there is a more perfect scenario but this works for me :v:
User presses on pay
The application makes a POST request to your application create session endpoint, with all needed information
In the backend, check if this user has an active session with the same information, if yes just redirect him to that active session id. If no just create another stripe session, record its info in your database and redirect the user to the new session id
Then add a purchase record with the amount/quantity the user is attempting to get (with status = pending) and the session id you have. Then update the items page and subtract this quantity...
Create a webhook with that session id. So you can know if it is done or not (you have to have an endpoint that accepts session ids)
You check your active sessions periodically (cronjob) if a session is too old (like one hour) you just delete it and delete the pending purchase then update the items count in your store back to the actual count.
And when stripe calls your webhook with the required events, you can now set the session status and purchase status to done (Don't forget to check the call signature for more security)
I hope this will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With