Search code examples
paypale-commercebraintree

Braintree sandbox accepts non-existent PayPal accounts?


It seems to me that you can type in any random username/password combination and both the drop-in UI widget and the backend will accept it as a valid PayPal account. The payment will go through and everything.

Is there a way I can set Braintree sandbox to only accept real PayPal accounts?


Solution

  • Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

    The Braintree Sandbox allows you to pass any email address and password you like into the PayPal dialog, as mentioned in Braintree's documentation. You can test with the fake PayPal nonces found on the Testing and Go-Live page, but keep in mind, Braintree didn't actually design the PayPal sandbox for handling end-to-end tests. All PayPal transactions made in the sandbox use the same, fake PayPal account. Because of that, there's no way to configure your Sandbox account to accept real PayPal accounts. We recommend that when you go live, you perform a few low-value sale transactions with each of the payment methods you plan to accept, including PayPal.

    You can test cases where the information in a PayPal account is bad in the same way you would test a bad credit card: use one of the fake invalid nonces from our Testing and Go-Live page. If your code is handling those cases correctly, you can be confident that it will be able to handle a PayPal account with bad information as well.