10

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.

fap
  • 663
  • 1
  • 5
  • 14
wdetac
  • 2,712
  • 3
  • 20
  • 42

4 Answers4

7

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

wdetac
  • 2,712
  • 3
  • 20
  • 42
5

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.

hollabaq
  • 597
  • 3
  • 13
  • I did all you mention before I ask, I have no idea why I fail – wdetac May 04 '18 at 03:36
  • 1
    @wdetac I recommend reaching out to [Braintree Support](https://developers.braintreepayments.com/forms/contact), they're going to need identifying information (your sandbox [merchant ID](https://articles.braintreepayments.com/control-panel/important-gateway-credentials#merchant-id)) to assist you further in finding out why it isn't working. – hollabaq May 04 '18 at 13:46
  • Update: I got it to work making another account not associated with paypal connected login :D – PauAI Mar 08 '19 at 15:40
0

I have same issue.

Turns out Paypal need me to verify my phone number and email address. But I haven't login to Paypal since 2016, so my information goes all wrong, finally I have to re-create my paypal account.

Allen Wong
  • 1,162
  • 1
  • 10
  • 15
0

Braintree doc: https://developer.paypal.com/braintree/docs/guides/paypal/testing-go-live#linked-paypal-testing

You have to link your Paypal account to Braintree

In order to link a PayPal sandbox test account to your Braintree sandbox account, you will need the API credentials for that PayPal sandbox test account.

If you don't already have a PayPal sandbox test account for testing your Braintree integration, create a new one by following these steps:

  1. Create a PayPal business sandbox account:

    • Log into the PayPal Developer Dashboard
    • Navigate to Sandbox > Accounts
    • Click Create Account
    • Select the same Country as your Braintree sandbox account
    • Select the account type as Business
  2. Go to the Create New App page

    • Create an app to get sandbox API credentials
    • Select the same sandbox developer account as the test account created in step 1
  3. Note the following Sandbox API Credentials for the new app you created:

    • Email address associated with this app
    • Client ID
    • Secret

Once you have those PayPal sandbox API credentials, enter them in your Braintree sandbox:

  1. Log into your Braintree sandbox Control Panel
  2. Navigate to Settings > Processing > Payment Methods > PayPal
  3. Click Link Sandbox
  4. Enter the Email address, Client ID, and Client Secret for your PayPal sandbox test account
  5. Click Link PayPal Sandbox
Mukesh Chapagain
  • 25,063
  • 15
  • 119
  • 120