I'm currently working with a project that needs to realize payments using PayPal accounts in some african countries. I could develop a demo project which allows me to interact with the API thanks to the test accounts registered in https://developer.paypal.com/developer/. Making some test cases I tried to specify a very long amount (in U$S) in order to see how to handle the error thrown. So, taking a look at this exception I see the following trace:
{"name":"VALIDATION_ERROR","details":[{"field":"transactions[0].amount.details.subtotal","issue":"Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point"},{"field":"transactions[0].item_list.items[0].price","issue":"Value too long (max length 10)"},{"field":"transactions[0].amount.total","issue":"Value too long (max length 10)"},{"field":"transactions[0].amount.total","issue":"Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point"},{"field":"transactions[0].item_list.items[0].price","issue":"Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point"},{"field":"transactions[0].amount.details.subtotal","issue":"Value too long (max length 10)"}],"message":"Invalid request - see details","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR","debug_id":"12d1b9e203241"}
Seeing the documentation mentioned on the information_link I see this paragraph:
Value too long (max length 10)
Provide a value that is 10 characters or less.
It's important to say that I'm working with american dollars as currency (ISO CODE: USD), so, at this point i'm wondering: what about other currencies? As I said, my application will be working with african countries like Nigeria (i.e.) whose currency is Naira valuated to 0.005013 U.S. dollars for each one, which could make that 10 decimal places are not enough. Someone has this issue? Shall I am always limited to 10 decimal places no matter the currency?
(I can't realize a currency conversion!)