#Andrew Samir
1 messages · Page 1 of 1 (latest)
Hi, what's the question?
I am using django and i am making a custom function to retry when something is wrong in db, but i make my payment in the middle of the retry function and thats up to my business logic
So i need help if there are any ways to prevent multiple payment in stripe ?
How are you making your payments?
using payment intents i am making a cron job to check my renewal date and if it is expire it get this package and repay then i use my db to save some balances
It's best to use webhooks to check that the payment is successful, and then do the business logic: https://stripe.com/docs/webhooks
yes but i cant change that now
i just need to know if there is a way to prevent retries on payment
You could make use of idempotency keys: https://stripe.com/docs/api/idempotent_requests
is that means i can make a unique key in my side and send it when paying ?
Yes
However, it's only a short term solution. You should confirm payments and execute business logic separately, as sometimes the payments take longer to succeed.
Please, let me know if you have any other questions.