Braintree PayPal结帐组件抛出"e.client.getVersion不是函数"; [英] Braintree PayPal checkout component throwing "e.client.getVersion is not a function"

查看:108
本文介绍了Braintree PayPal结帐组件抛出"e.client.getVersion不是函数";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力了解我在这里做错了什么:

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 (...) { ... }
    })
 });

调用 braintree.paypalCheckout.create 时,会同时调用一个错误:

When calling braintree.paypalCheckout.create, an error is called synchronously:

未捕获的TypeError: e.client.getVersion 不是函数

实际上, client 对象没有这种方法.我遵循了此页面中的代码此页面(大致相同东西).

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).

如何解决该问题?PayPal Checkout组件已加载并附加到 braintree 对象.

How to fix the problem? The PayPal Checkout component is loaded and appended to the braintree object.

推荐答案

完整披露:我在Braintree工作.如有其他疑问,请随时与支持.

getVersion client 类的方法作为的版本3.16.0 的版本.将您正在使用的 braintree-web 的版本更新为3.16.0 +.

getVersion is a method of the client class as of version 3.16.0 of braintree-web. Update the version of braintree-web you're using to 3.16.0+.

这篇关于Braintree PayPal结帐组件抛出"e.client.getVersion不是函数";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆