Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayPal integration from Braintree sandbox error: PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED

I got this error when I try to test my PayPal integration from Braintree.

Here is my client code (actually copy from official site and make little modification):

braintree.client.create({
    authorization: ClientToken
}, function(err, clientInstance) {
    if (err) {
        console.error(err);
        return;
    }

    // Create a PayPal Checkout component.
    braintree.paypalCheckout.create({
        client: clientInstance
    }, function (paypalCheckoutErr, paypalCheckoutInstance) {
        // Stop if there was a problem creating PayPal Checkout.
        // This could happen if there was a network error or if it's incorrectly
        // configured.
        if (paypalCheckoutErr) {
            console.error('Error creating PayPal Checkout:', paypalCheckoutErr); // Error from this line
            return;
        }
    });
});

Error creating PayPal Checkout: 
{
    name: "BraintreeError",
    code: "PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED",
    message: "A linked PayPal Sandbox account is required to use PayPal Checkout in Sandbox. See https://developers.braintreepayments.com/guides/paypal/testing-go-live/#linked-paypal-testing for details on linking your PayPal sandbox with Braintree.",
    type: "MERCHANT",
    details: undefined
}

I have actually link my PayPal sandbox account (from the Braintree control panel) and surprisingly cannot find any useful information about this error. Of course I have read through https://developers.braintreepayments.com/guides/paypal/testing-go-live/node#linked-paypal-testing.

like image 506
wdetac Avatar asked May 03 '18 05:05

wdetac


People also ask

How do I change my PayPal from sandbox to live?

Manage your REST API apps in the REST API apps section of My Apps & Credentials page. To move between sandbox and live settings, click the Sandbox or Live toggle.


2 Answers

I finally turn out open another Braintree sandbox account solve this problem. It is weird however I cannot solve by anything else.

like image 98
wdetac Avatar answered Sep 30 '22 12:09

wdetac


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

There are two sandbox accounts that you need to link together: your Braintree sandbox, and your PayPal sandbox.

Double check that you have followed the instructions in Braintree's documentation to link your PayPal sandbox account to your Braintree sandbox account within the Control Panel.

If you continue to see this error, please contact Braintree Support for assistance.

like image 23
hollabaq Avatar answered Sep 30 '22 13:09

hollabaq