I'm struggling to understand what I'm doing wrong here:
braintree.client.create({
authorization: res.clientToken // this is the token, I know it is correct
}, (err, client) => {
if (err) { ... }
braintree.paypalCheckout.create({ client }, (err, paypalInstance) => {
if (...) { ... }
})
});
When calling braintree.paypalCheckout.create
, an error is called synchronously:
Uncaught TypeError:
e.client.getVersion
is not a function
Indeed, the client
object doesn't have such a method. I followed the code from this page and this page (pretty much the same thing).
How to fix the problem? The PayPal Checkout component is loaded and appended to the braintree
object.