我正在使用Braintree Sandbox,每当我尝试付款时,我都会收到DropIn的错误消息,说:
名称:“ DropinError”,消息:“没有可用的付款方式。”, _braintreeWebError:未定义
我做了什么以证明自己一切都很好:
在选择Braintree付款方式后,我页面的最终结果是:
它说没有可用的付款方式,但是我可以看到“ 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');
});
我想念什么?