braintree / braintree_php

Braintree PHP library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
546 stars 224 forks source link

What's the correct amount format? #252

Closed paq85 closed 5 years ago

paq85 commented 5 years ago

General information

Issue description

When I create a transaction I'm supposed to provide the amount as a string. But what's the amount format?

In examples and tests I can see that for example for $128.55 I should send 128.55.

  1. But what's the correct format for $18,002.99? Is it 18,002.99?
  2. Should I assume that the amount string should be in USD currency format?
  3. Should I use USD format for other currencies as well?

It would be nice to have it explained in PHP SDK doc - at least some examples for big amounts.

crookedneighbor commented 5 years ago

Here are the docs for amount: https://developers.braintreepayments.com/reference/request/transaction/sale/php#amount

The billing amount of the request. This value must be greater than 0, and must match the currency format of the merchant account. Can only contain numbers and one decimal point (e.g. x.xx). Can't be greater than the maximum allowed by the processor. Contact us for your specific limit.

The Can only contain numbers and one decimal point bit and must match the currency format of the merchant account is what you're looking for.

For additional help, please reach out to our support team. https://help.braintreepayments.com/