#Desa

1 messages · Page 1 of 1 (latest)

sour isleBOT
lean elk
#

can you also share the request id where you got that error?

jagged dirge
#

No, I just used the 424242 one.
I'll try the 4000000000000077 one now.

#

That seemed to solve the issue, i guess it was pending.

lean elk
#

what you would want to do when creating the Transfer is to include the corresponding Charge id in the source_transaction parameter : https://stripe.com/docs/api/transfers/create#create_transfer-source_transaction

The main point to remember is that when using source_transaction, if the payment is still pending, then the transfer will pull the funds from the pending balance. If the payment is already available, then the transfer will pull the funds from the available balance.

if you don't specify the source_transaction, it'll always try to use the funds from your available balance and if the payment funds is not yet available, and you don't specify the source_transaction then you run into the problem of insufficient funds

jagged dirge
#

Is there a check we can write in rails to make sure we have a sufficient balance before processing the transfer? I could google but you might know off the top of your head

lean elk
#

you can always retrieve the balance before making a transfer, but it seems a bit redundant - you'd know that you have insufficient funds when the request fails

jagged dirge
#

We're doing it a week in arrears, so we won't always have a corresponding transaction, and will just be using the balance in our account, so it would be a good check before we processed the automatic job in our rails API to raise a sentry error that we need to top-up and run again.

lean elk