Braintree-没有可用的付款方式

时间:2020-10-17 17:43:40

标签: javascript php paypal braintree

我正在使用Braintree Sandbox,每当我尝试付款时,我都会收到DropIn的错误消息,说:

名称:“ DropinError”,消息:“没有可用的付款方式。”, _braintreeWebError:未定义

我做了什么以证明自己一切都很好:

  1. 再次检查Sandbox Braintree API凭据
  2. 按照Braintree Sandbox的要求/要求,在“付款方式”中使用我的App SandBox在Paypal中的凭据连接Paypal

enter image description here

在选择Braintree付款方式后,我页面的最终结果是:

enter image description here

它说没有可用的付款方式,但是我可以看到“ Card”和“ Paypal” UI的付款方式,但是我不能全都不用。

我用PHP生成ClientToken,如下所示:

$gateway = new \Braintree\Gateway(
[
    'merchantId' => env('BRAINTREE_MERCHANT_ID'),
    'publicKey' => env('BRAINTREE_PUBLIC_KEY'),
    'privateKey' => env('BRAINTREE_PRIVATE_KEY'),
    'environment' => env('BRAINTREE_ENVIRONMENT')
]);

$token = $gateway->clientToken()->generate();

然后用Java语言做的就是:

// Double checked, its ok!
var token = $('#braintree_token').val();

braintree.dropin.create(
{
    authorization: token,
    container: '#braintree-container',
    paypal:
    {
        flow: 'vault',
    }
}, function(err, instance)
{
    // Error starts after this call
    instance.requestPaymentMethod(function(err, payload)
    {
        // Never reaches here!
        console.log(payload);
    }, 'json');
});

我想念什么?

0 个答案:

没有答案