How the "value" field provided in the callbacks work?

The value field that we provide in our Callback (or IPN) it's basically just the value paid but in a integer. This is meant to make easier to some platforms to do precise calculations.

However in Stablecoins this field has a specificity. It always come rounded to "cents" (two decimals), meaning you must always divide it by 100. The Stablecoins where this happens are in the following list:

USDC (BEP-20)
BUSD (BEP-20)
USDT (BEP-20)
EURT (ERC-20)
TUSD (ERC-20)
USDP (ERC-20)
BUSD (ERC-20)
USDC (ERC-20)
USDT (ERC-20)
HUSD (TRC-20)
TUSD (TRC-20)
USDC (TRC-20)
USDT (TRC-20)

If you're using one of the mentioned Stablecoins, the value field will always have two decimals, which means you must divide it by 100 to get the value paid correctly.

We advise you to use the value_coin field instead with this tokens since it handles more than two decimal cases (very important in case your user sends a value with more than two decimal fields).

Was this article helpful?

1 out of 1 liked this article

Still need help? Message Us