#markus-transfers

1 messages ยท Page 1 of 1 (latest)

waxen urchin
#

hello, looking one sec

#

give me a few mins more. not fully clear on why the BalanceTransaction (BT) was created ~3 mins after the PaymentIntent went into processing

magic merlin
#

No problem ๐Ÿ™‚ IF you need anything, just tell me

magic merlin
#

Here's what I do. Maybe there is something wrong.

When creating the paymentIntent (Klarna/SOFORT) i set the TransferGroup ex. "2021-09-17/dKda3d".
After the payment intent is authorized and the PRocessing WebHook arrives my backend, I create the transfers for the connected accounts.
Where I just set the source transaction with the corresponding chargeId from the paymentIntent like you can see in the code above.
Should I set a transfer group too on the Transfer? ๐Ÿค”

waxen urchin
#

so the issue is that the BT on the PaymentIntent wasn't created at the time you created the Transfer

#

and I'm trying to see if that is expected or not

magic merlin
waxen urchin
#

yeah so while you're right, the case above is when you would have a BT, just that the BT would have a field for available_on stating that the funds become available at a later time

the issue here is that the BT wasn't created then at all

source_transaction uses the BT to make the Transfer pending right now, then actually move funds later when the Balance is available.

trying to repro ...

magic merlin
#

Thanks for your great support! This is not a matter of course!

waxen urchin
#

ok so the BT being null initially is expected since it is an async PaymentMethod.

You should instead create the Transfer when the PaymentIntent moves from status: processing to status: succeeded so when you get the payment_intent.succeeded webhook event

the BT will be created then and will still have funds available to your Balance at a later date but then you can still initiate the Transfer and have it transfer when the Balance becomes available

magic merlin
#

Okay thank you. As I expected and as it currently works on production. We are changing some internal things and I have two options two implement a new feature. Guess theres only one option left now. Thank you!!