Closed ShaunDychko closed 6 years ago
It turns out that the failOnDuplicatePaymentMethod
option needs to be passed to the token generator in order to take effect. See https://developers.braintreepayments.com/reference/request/client-token/generate/php#options.
General information
Issue description
When creating a new payment method using the same credit card number, expiry, cvv, and postal code as an already vaulted card for a different customer, the request does not fail despite passing the
'failOnDuplicatePaymentMethod' => TRUE
option. In other words, the code snippet in the Braintree API referencedoes not work as expected. This is despite failing as expected when creating a new customer with an already vaulted credit card.
Steps to reproduce
If you use a duplicate card for one of the customers, it will fail as expected.
The
$result
will be successful, even though expected behavior is for it to fail.