Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Payments Pro American Express Adjustment #420
I've been getting reports lately from users trying to accept Amex with currency codes other than USD. Those are getting rejected with invalid currency code errors. Apparently Amex only supports USD.
We need to verify that USD is the only one it supports (maybe it supports a few others, too..??) and then make sure the Amex option doesn't show up if the currency in WooCommerce is set to an unsupported Amex value.
Ah, right, I forgot the new method does not have a drop down for the card type.
As such, we must have some logic that is setting the card type based on the credit card number, right?
Can we add some validation so that if the card type ends up being Amex but the currency is not USD we return a validation error?
added a commit
Mar 11, 2016
I'm a little confused here. It looks like you're only throwing the validation error if the currency is CAD..??
CAD would actually be compatible according to this table: https://developer.paypal.com/docs/classic/api/currency_codes/#creditcard
So we should actually check if the currency code is not one of the compatible values from that table, and show the validation error if it's not in the list. So basically, these should be allowed: AUD, CAD, EUR, GBP, JPY, USD
Any other currency code, if Amex is the card type, should throw the validation error.