贝宝与 Braintree 说 "Merchant account not found"

Paypal with Braintree saying "Merchant account not found"

我尝试使用 braintree 集成 PayPal 并遵循 this tutorial. I end up getting an error: Merchant account not found - screenshot。

我正在使用 Swift 3 和 Xcode 8.1。

here is my viewDidLoad

这些都是我的应用程序所需的更新:

ScreenShot 1

ScreenShot 2

ScreenShot 3

ScreenShot 4

ScreenShot 5

任何帮助将不胜感激!

就我而言,这是我的沙箱帐户的问题,我通过与 braintree 支持人员沟通解决了同样的问题。

ME : I have setup a Braintree sandbox account to make test PayPal payments. The userid is xxx@zzz.com 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).

PayPalBraintree 对我不起作用,就像我一次又一次收到此消息一样。

"Merchant account not found"

因此,我决定集成 PayPal ios SDK,并且我自己在应用程序中集成了 未来付款(不使用后端服务器)。在 PayPal 开发人员支持的帮助下,这一切都完美无缺。

此错误也可能是由容易遗漏但很容易修复的问题引起的。

要初始化您的客户端,您需要在您的服务器上生成一个客户端令牌。生成此文件时,您可以选择传入 商家帐户 ID - 例如 Java:

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

您的商家 ID商家帐户 ID 之间存在细微但重要的区别:

来自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.

在创建客户端令牌时提供错误的商家帐户 ID 不会产生错误,直到您尝试执行某些操作,例如,使用paypal 保险库流程,在这种情况下,您的客户将收到“422 Unprocessable entity”响应 “找不到商家帐户”错误消息。

我认为您需要 link 一个 PayPal 帐户(沙盒或生产)。转到处理-> 付款方式并启用 PayPal。之后转到PP开关下的选项。从那里您需要输入 PayPal Sandbox Credentials

在我的例子中,由于在创建帐户时选择了 Paypal 不运行的国家/地区,因此无法使用。我刚刚在 Paypal 运营所在的国家/地区创建了一个新帐户,它解决了这个问题。