I'm using Braintree Sandbox and whenever I try to pay I receive an error of DropIn, saying:
name: "DropinError", message: "No payment method is available.", _braintreeWebError: undefined
What have I done to certify myself that everything is alright:
- Double check the Sandbox Braintree API Credentials
- Connected Paypal in the "Payment Methods" as asked/required by Braintree Sandbox with the credentials of my App SandBox in Paypal
The end result in my page, after choosing the Braintree payment method, is:
It says no payment method is available, yet I can see the "Card" & "Paypal" UI payment methods, but I can't pay with none of them.
I generate the ClientToken in PHP like the following:
$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();
And then in Javascript all I do is:
// 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');
});
What am I missing?

