Problems with amount square

47 views Asked by At

I have the following problem using nodejs sdk.

It turns out that a platform that processes payments of 200 usd and up.

Apparently the payments in the square system go wrong.

In my personal system they are well saved in the database with the amount entered.

The amount is sent and converted into a whole number.

Example of delivery: 1,250.00 and it becomes 1250 but in square it takes it as 12.50, I await your response, thank you

Example transactions

1

There are 1 answers

0
MaxV On

You should multiply your amount by 100 since it's amount of cents. So instead of 1250 you should send 125000.

Square's API documentation:

All monetary fields in Square APIs are represented by a Money object with an amount field in the smallest denomination of the currency indicated by currency_code. For example, the following code represents 400 cents ($4.00 USD):

{
  "amount": 400,
  "currency_code": "USD"
}