#mightymealworm_best-practices
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/1313642696396636222
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
The API error I'm getting looks like this:
Failed to create a transfer: Transfers using this transaction as a source must not exceed the source amount of $137.86. (There is already a transfer using this source, amounting to $124.07.)
Sure thing! req_LNLKOhqcT70tAX
Hello! I'm taking over and catching up...
The easiest way to do this would be to specify the remianing amount to transfer in USD, as the original charge was in USD.
Thanks for helping me look into this! I get a different API error when I try this:
Failed to create a transfer: The currency of source_transaction's balance transaction (cad) must be the same as the transfer currency (usd)
Request ID: req_PUk5N7Ww0a9EwB
Does that mean in the case of a currency conversion I'm not able to take advantage of the source_transaction field?
Oh, I didn't notice that, sorry. Those currencies do need to match. You can use source_transaction, but you need to do the currency conversion on your end. See here for details: https://docs.stripe.com/currencies/conversions#foreign-exchange-rates
Okay that makes sense! And we'd need to use the conversion rate of the charge rather than the refund so that we don't run into that first issue again where we're trying to transfer more than the source amount.
Just to confirm, what are the rounding rules we should use when doing the conversion? I noticed the conversion rates are quite precise so we'll need to round to the nearest cent. I want to make sure we don't end up a cent over in some cases so our transfers don't fail ๐
I'm honestly not sure what the current rounding rules are, and I'm not sure they're set in stone. If I were building this I would always round up, make the attempt, and if it fails make a second attempt after rounding down.