#mightymealworm_best-practices

1 messages ยท Page 1 of 1 (latest)

empty geodeBOT
#

๐Ÿ‘‹ 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.

thorny crown
#

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.)

solar shadow
#

Hi there

#

Do you have a request ID you can share? It should begin with req_

thorny crown
#

Sure thing! req_LNLKOhqcT70tAX

empty geodeBOT
untold sparrow
#

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.

thorny crown
#

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?

untold sparrow
thorny crown
#

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 ๐Ÿ˜…

untold sparrow
#

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.