#tld_api

1 messages · Page 1 of 1 (latest)

small ravineBOT
#

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

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

  • tld_api, 4 hours ago, 18 messages
junior spire
#

You're specifying a different currency in the transfer than in the charge

#

The charge was in kr

#

Transfer in SEK

#

That's why you're getting insufficient funds

#

source_transaction only prevents those insufficient funds errors if you're dealing with the same currency

stiff stag
#

thanks, but i see in all relevant calls it is SEK.
this is the request-id for payment-intent created. req_GxjA64IqrgArfW

when i look at the charge details, it is SEK too. but just in lower-case.

is that the problem?

junior spire
#

Ok I think I know what's happening now

#

Oh wait sorry

#

Nvm

#

Kr and SEK are the same

#

Let me ask a colleague

#

Will get back to you

stiff stag
#

yes, i am from that country --)

junior spire
#

Yes sorry I was unfamiliar that both abbreviations are for the same currency

#

Ok so the issue is you're using the available balance test card: https://docs.stripe.com/testing#available-balance. Normally, in live mode, funds don't go straight to your available balance. They go to pending balance first. When funds are in pending balance, you can use source_transaction to pull those funds. However, that doesn't work if funds are in your available balance. So, you should just use the 4242 test card to test this flow instead

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods and redirects.

stiff stag
#

so do you say in "live" account we will not have this problem as long as we provide the source_transaction ?
and we do it

junior spire
#

As long as funds are still in the pending balance, yeah

#

Testing with the 4242 card will give you a more accurate test

stiff stag
#

thanks a lot, especially your answer on the "live" account case relieved me at the dawn of a system release

junior spire
#

You should still test this thoroughly though before going live

#

With the 4242 card

rugged mesa
#

Hi @junior spire , I'm a colleague of @stiff stag working on this integration.

What would happen if the funds are available when we create the transfer with the source_transaction?

#

(in live mode)

#

we are using the payment_intent.succeeded event to get the last charge_id and using it to create the transfer

junior spire
#

The same thing that happened above with the test card that makes funds immediately available

rugged mesa
#

As long as funds are still in the pending balance, yeah

so, is it correct to say that providing the source_transaction will pull the funds from the pending balance even if the funds are already available for the source transaction?
I'd have expected it to succeed if the funds are available

stoic copper
#

Hi there 👋 jumping in as my teammate needs to step away soon. Bear with me a moment while I take a closer look at the state of the things when the request failed, or did you happen to record the output of retrieving the balance of your account from the API when the request failed?

rugged mesa
#

no, we haven't checked the balance immediately when it failed

stoic copper
#

so, is it correct to say that providing the source_transaction will pull the funds from the pending balance even if the funds are already available for the source transaction?
No, I don't think this is correct. If the transaction is already available I believe we try to pull from the available balance for your account. The most recent balance.available Event for your account before that request was made makes it look like there wasn't enough in your available balance to cover the transfer:
https://dashboard.stripe.com/test/events/evt_1PtSnWPb6ICU7VfSDnfvPSJE

rugged mesa
#

But we are providing the charge_id for the transfer just to prevent this, according to stripe docs:

The default behavior is to transfer funds from the platform account’s available balance. Attempting a transfer that exceeds the available balance fails with an error. To avoid this problem, when creating a transfer, tie it to an existing charge by specifying the charge ID as the source_transaction parameter. With a source_transaction, the transfer request returns success regardless of your available balance. However, the funds don’t become available in the destination account until the funds from the associated charge are available to transfer from the platform account.

Create charges on your platform account and transfer funds to multiple connected accounts.

#

so my expectation is:

if we use test card 4242, the funds are in pending status, the transfer creation call should succeed and the transfer balance be in pending status.
If we use test card 400..07 the funds become available immediately, then the transfer creation should succeed and the transfer balance made available immediately in the connected account.

Is something wrong with my assumption?

stoic copper
#

That all sounds right, though the second one depends on the funds still being available when you make the Transfer request. If you try to make the Transfer request again using the same source_transaction ID, does it still fail? If so, can you retrieve the balance from your account and share those outputs?

rugged mesa
#

sure, let me try that

stoic copper
#

Also, in a real-world example I also think it's unlikely that you'd ever see a payment immediately become available, unless you've spoken with our Support team and they've told you your account is set up for that. That test card doesn't exist to mimic a real scenario, it exists so the pending balance state can be bypassed to accelerate testing.

rugged mesa
#

create transfer request id: req_I1H1lCU78Tuqm8
And the balance is 0 SEK, so I think it makes sense

stoic copper
#

Yeah, if the available balance for sek is 0, then I'd expect all transfer requests to fail unless they provide the ID of a Charge that is still pending to source_transaction