2017-07-06 48 views
1

我努力理解我在做什麼錯在這裏:布倫特裏PayPal支付組件拋出「e.client.getVersion是不是一個函數」

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,錯誤被稱爲同步:

Uncaught TypeError: e.client.getVersion is not a function

確實,client對象沒有這樣的方法。我遵循this pagethis page(幾乎相同的事情)的代碼。

如何解決這個問題? PayPal Checkout組件被加載並附加到braintree對象。

回答

3

完全披露:我在布倫特裏工作。如果您有任何其他問題,請隨時聯繫support

getVersionclient類的braintree-webas of version 3.16.0的方法。更新您使用的版本braintree-web至3.16.0+。

+0

是的,我想我正在使用'3.9.x'。謝謝! –

+1

我得到e.getVersion不是使用data-collector.min.js使用3.25.0版本的功能。這是相關的嗎? – otherDewi