#stenerali_banktransfer-partialpayment
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/1220144070626770954
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
...continued
- bill customer another $100 and they signal they will use bank transfer again.
I'm seeing that the created payment intent immediately has an outstanding amount of $80 but no webhook got fired to indicate a partially_funded intent or cash_balance.funds_available changed.
So what is the suggested workflow for detecting when a balance was used on a newly created intent?
@shy silo do you have an example PaymentIntent id I can look at?
stenerali_banktransfer-partialpayment
One sec, I'll create a couple.
pi_3OwY9nGbF4GB4p161USwuEs4 for the first one. pi_3OwYBHGbF4GB4p161d6KGUfM for the 2nd one that immediately used the $20 balance
ack looking but going to take me a bit of time, I struggle a bit to understand that API myself ๐
no rush. for context, our platform is an accounting platform. So we would record the overpayment when we see cash_balance.funds_available events. The question is really what is the webhook or condition on the 2nd payment_intent that tells us the balance was used.
okay so I see https://dashboard.stripe.com/test/events/evt_1OwYBJGbF4GB4p16hAJbIbAf which indicates the funds were pulled from the Customer's CashBalance right?
I agree it's strange to not see payment_intent.partially_funded though, trying to reproduce
ok i see that event, yes
give me ~10 minutes to reproduce this end to end with a test script to try and see what's up
I'm suspecting customer_cash_balance_transaction.created is a webhook we might need to handle?
no rush.
yeah that Event type is telling you when funds come in or move out of the CashBalance so it's important
oooookay sorry took me a while to have an end to end repro. I had only worked with the JP/MX ones end to end before.
So I also don't get that payment_intent.partially_funded Event either, looking into why now
Okay confirmed with my team and now I get it. That Event is specifically when the end customer is supposed to pay $100 but sends only $50. So that Event isn't sent when we pull in from the CashBalance itself.
I can see how it makes sense now, just thought about it the wrong way and I assume you did too
So how as the platform are we supposed to know the intent was partially paid?
When you confirm the PaymentIntent, or when it gets confirmed, you'd know immediately in the next_action as it would have the amount_remaining so you would use that
ok, so i create intent for $100, the next_action amount_remaining is $80 (so check if it's != 100), but what on the payment intent tells me the difference was from a cash_balance transaction? There are no charges on the intent and you can't query transactions by payment_intent id
It can only be from the CashBalance
and you would have a CashBalanceTransaction with applied_to_payment
And that object would have applied_to_payment: { payment_intent: "pi_123" },
that's what I see on my end to end test
| It can only be from the CashBalance
This is probably the key thing that will help. It would be nice if we could get associated cash balance transactions via the payment intent ID instead of having to scan through history (we're a large volume platform).
One other question. For automatic reconciliation, the docs says it can be applied to any incomplete payment_intent based on teh rules here https://docs.stripe.com/payments/customer-balance/reconciliation?lang=node#cash-automatic-reconciliation. Can you confirm that it would ONLY be applied to payment intents with customer_balance as the attached payment method? Or would it get applied to other incomplete intents if they happen to exist?
no it'd be just for customer_balance ones
ok. This has been really helpful. Thanks for walking through it.
Sure thing!
sorry, one more question. can a partially funded bank_transfer intent be cancelled?
(usecase: customer picked bank transfer, but has changed their mind and wants to pay be something like credit card or ach debit)
the answer is yes (just did it) and the partial amount got returned to the cash_balance.
haha I was in the middle of testing and was hoping that'd be the answer!