Anurag Sharma
Anurag Sharma

Reputation: 4855

Paypal with Braintree saying "Merchant account not found"

I tried integrating PayPal using braintree and following this tutorial. I end up getting an error: Merchant account not found - screenshot.

I am using Swift 3 and Xcode 8.1.

here is my viewDidLoad

These are all required updates in my app:

ScreenShot 1

ScreenShot 2

ScreenShot 3

ScreenShot 4

ScreenShot 5

Any help will be appreciated!

Upvotes: 6

Views: 8442

Answers (5)

Ali Murtaza
Ali Murtaza

Reputation: 550

In my case, it was not working due to the selection of country during account creation where Paypal does not operate. I just create a new account with the country where Paypal operates and it solved this issue.

Upvotes: 1

Rajesh N
Rajesh N

Reputation: 6693

I believe you need to link a PayPal account (either sandbox or production). Go to Processing->Payment Methods and enable PayPal. After that go to Options under the PP switch. From there you need to enter the PayPal Sandbox Credentials

Upvotes: 1

Jim Riordan
Jim Riordan

Reputation: 1428

This error can also be caused by a gotcha that's easy to miss but simple to fix.

To initialise your client, you generate a client token on your server. When generating this you can optionally pass in a merchant account ID - for example in Java:

ClientTokenRequest clientTokenRequest = new ClientTokenRequest()
                                              .customerId(aCustomerId)
                                              .merchantAccountId(anAccountId);
String clientToken = gateway.clientToken().generate(clientTokenRequest);

There is a subtle but important difference between your merchant ID and the merchant account ID:

From the Braintree Control Panel reference:

Your merchant ID is a unique identifier for your entire gateway account and one of the four API credentials. This value is required for certain actions, such as connecting your API calls to the Braintree gateway or setting up third-party shopping carts.

Your merchant account ID is a unique identifier for a specific merchant account in your gateway. It is used to specify which merchant account to use when creating a transaction, creating a subscription, verifying a payment method, or generating a client token.

Supplying the wrong merchant account ID at client token creation time won't produce an error until you try to perform certain actions, for example, making a payment method request using the paypal vault flow, in which case your client will receive a "422 Unprocessable entity" response with the "Merchant account not found" error message.

Upvotes: 5

Anurag Sharma
Anurag Sharma

Reputation: 4855

PayPal with Braintree didn't work for me like I was getting this message again and again.

"Merchant account not found"

So, I decided to integrate PayPal ios SDK and I managed to integrate Future payment myself within the app(without using backend server). And that worked flawlessly with the help of PayPal developer support.

Upvotes: 0

Anand Vaidya
Anand Vaidya

Reputation: 1461

In my case it was an issue with my sandbox account, and I solved the same with communicating with braintree support.

ME : I have setup a Braintree sandbox account to make test PayPal payments. The userid is [email protected] I am able to test hosted fields properly using this account, however I get Merchant account not found when I try to use the same client for PayPal. Can you please help me if I am missing any configuration?

Braintree Support : Your Sandbox merchant accounts don't have PayPal enabled which could explain the error you are witnessing. I added PayPal as processor for your default merchant account (MobikonDefault). Please try again and if the problem appears again, I would need you to provide your ClientToken API call and the exact time you reproduced the issue (including timezone).

ME : Thanks, that worked. Although I would like to know if I can do this configuration myself. I did not find any path to do so.

Braintree Support : Thanks for reaching back out to us. Currently, there is no way to set this up from the merchant side - this is a direct configuration on our backend that we have to set up (the one that Elvis set up for you).

Upvotes: 4

Related Questions