#alessandromontanari_unexpected
1 messages ¡ Page 1 of 1 (latest)
đ 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/1286329570978431028
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Can you share the PaymentIntent ID that you tested with?
Sure, in test mode: pi_3Q0jSAFTgZEmRcC40QEX6f2j
Here the snippet I've used to update the payment intent
const res = await stripe.paymentIntents.update("pi_3Q0jSAFTgZEmRcC40QEX6f2j", {
amount: 300 * 100,
})
Ah sorry, the amount is automatically refunded because we have a system with a webhook that when receive the info that the amount in the cash balance is >0 it refunds it to the customer. It's a logic of our application. The weird part is the "unapplied" action. And in this case the funds have been applied to another uncompleted payment intent
Hi taking over here
Hi!
What do you mean by unapplied action?
I was repeating your colleague's words
The main question is why "partial amount" is not applied to the original payment intent
Ok can you share the refund request id and the payment intent id that funds were applied to so I can look further?
I've created another scenario with less dirt
Customer cus_PVPJBf5nUINx9y
Payment intent pi_3Q0lcqFTgZEmRcC41B0cI3uV
Initial amount: 5000 euros
Partially funded with 1000 euros
Update the amount to 300 euros
1000 euros unapplied from the payment
1000 euros avaiable in the cash balance
1000 euros refunded by my backend
The refund is not a problem. the application that is using stripe is built to refund all cash balance avaiable. The problem is the "unapplied from the payment"
Gotcha looking
Where are you seeing that transactions section in the dashboard?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Gotcha
Will confirm internally, but I'm assuming that we have logic to move the partially applied funds back to the customer balance if you update the payment intent's amount after it's partially funded
Can't think of a reason off the top of my head, but let me look into why we'd do that
Sure, thanks.
Actually, the real goal would be to make a refund starting from an uncompleted payment intent. Can you confirm that this possibility does not exist and that there is no other way to obtain it? I'm trying to update the amount for this reason
Ah:
Caution
When you change the amount of a partially funded PaymentIntent, the funds are returned to the customer balance. If other PaymentIntents are open, Stripe funds those automatically. If the customer is configured for manual reconciliation, you need to apply the funds again.```
From: https://docs.stripe.com/payments/bank-transfers/accept-a-payment?invoices=without&platform=web#element-confirm-success
Actually, the real goal would be to make a refund starting from an uncompleted payment intent
What do you mean by this
for reporting reasons I need to start a refund linked to a specific payment intent (which corresponds to a specific service in my system)
In this case the amount is unapplied by the payment intent and I've lost the possibility to automatically reinsert it in the payment intent
Why are you updating the payment intent amounts after they're partially funded?
It was a try. I was trying to bring the payment intent to a succeeded status
Do you have any idea how to achieve the goal in another way?
Or a way in the cash_balance.funds_available to understand that it's generated by a "unapplied from payment intent" action to avoid the refund and re-apply to same payment intent
In this scenario you'd need to either have the customer fully pay the payment intent before refunding them, or you'd need to cancel the payment intent to return the funds back to the customer balance and then you can refund the customer balance back to the customer via: https://docs.stripe.com/payments/customer-balance/refunding#create-return-dashboard--api
However, if you have automatic reconciliation enabled, then funds might get applied to another payment intent once they're send back to customer balance (which you saw above)
So you'd need to use manual reconciliation to avoid this
Oks, thanks for the support!