#ali-osaid_api

1 messages ¡ Page 1 of 1 (latest)

teal rapidsBOT
#

👋 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/1292986983999864993

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

south moss
#

Hello! Can you provide more details? Not sure I understand your question.

pure dome
#

For example, when we create a payment intent and then confirm it, the amount goes to the pending balance. We hold that amount for the user and do not allow them to make any purchases from the app until it moves into the available balance. Like many other companies, we provide users with digital currency. However, if the amount remains in the pending balance and then gets refunded while the customer has already used our service, it creates a problem thats why is there any way ?.

#

to know that this user amount has been reached to available balance so we can update his/her wallet so they can purchase from the app

south moss
#

Beyond that those specific funds are no longer linked to a specific Customer beyond the record of the transaction represented by the objects like the Payment Intent, Charge, Balance Transaction, etc.

pure dome
#

We have a situation where we allow users to make purchases using our app by creating and confirming a payment intent. Initially, the amount moves into the pending balance, and we provide the user with digital currency equivalent to that amount. However, if the funds remain in the pending balance and later get refunded (before they reach the available balance), there is a risk that the customer has already used our services without completing a successful payment.

south moss
#

Yep, that makes sense. Do you have another question?

pure dome
#

I mean, how can we overcome this issue? What approach should we use? Many companies are using Stripe, and I need to figure out what we might be doing wrong.

south moss
#

Don't issue a refund if they've already made a purchase, or take back what they purchased when issuing the refund.

#

Or wait until the funds land before allowing purchases to be made.

pure dome
#

im using payment intent so i should not allow user to make purchase from the app until that payment intent status has been change to succeeded will that work ?

south moss
#

It really depends on the specifics of what you're building and how you want it to work.

#

I'm a little unclear on how the refunds are happening in the scenario you describe. Are you creating the refunds?

pure dome
#

No, we are not initiating refunds ourselves. Let's say a user tops up their wallet with a certain amount. We first create a PaymentIntent and then confirm it. The user then uses our application services for two days. Meanwhile, for some reason, Stripe refunds that amount while it is still in the pending balance, meaning the funds never reach the available balance.

south moss
#

That doesn't make sense to me. Why would Stripe refund it? What would be the reason?

pure dome
#

Fraud Detection
Risk Assessment

#

the payment gets reversed or fails

south moss
#

Ah, okay, so the transaction would be reversed for fraud/risk reasons. Yes, that can happen. If you want to avoid that you would need to wait until it lands in your available balance.

pure dome
#

so i need to listen to webhook event for payment intent status ?

#

once it get succeeded means its available now ?

south moss
#

No, the Payment Intent's status isn't used for what you're asking about.

#

The Payment Intent's status might immediately fail because it's blocked as a risky transaction. If it succeeds, that means the transaction succeeded but the funds are pending. Then, in time, those funds will become available.

pure dome
#

you are saying if the payment intent status gets succeeded the amount will move to available balance for sure ?

south moss
#

It should, yes, but it may not under rare circumstances.

#

The Payment Intent's status will never change again after it's succeeded though.

#

But if it's refunded you'll see a Refund created.

pure dome
#

okay thanks for the help

south moss