#Xequinox
1 messages · Page 1 of 1 (latest)
hello! you can use https://stripe.com/docs/api/payment_intents/cancel
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so this way, I can limit payment intents for a user
so they can only have 1 valid intent at a time
but I still have an issue if multiple users have used the same coupon code and make payments at the same time
I am trying to limit the coupon code's uses
but checking for the usage in the intents is not enough
it must be considered "used" when the payment is completed
but if two intents have used the same code, the time it takes for the webhook to reach the server and say the code is used may take too long
so then the code will be used twice
the users will have both paid
but only 1 is considered valid for me, on fulfillment of the second webhook, I must refund them or what?
is there a better solution than allowing them to pay and refunding it