简体   繁体   English

PayPal 结帐 Braintree 行项目

[英]PayPal Checkout Braintree Line Items

I'm trying to use Braintree with the PayPal Checkout SDK (sandbox environment) however everytime I try and add in line items, I get a 'create_order_error' 'PayPal error undefined: could not initialise paypal flow'.我正在尝试将 Braintree 与 PayPal Checkout SDK(沙盒环境)一起使用,但是每次我尝试添加订单项时,我都会收到“create_order_error”“PayPal 错误未定义:无法初始化 paypal 流程”。 This is only when I add in the lineItems option:在我添加 lineItems 选项时:

...
 return paypalCheckoutInstance.createPayment({
                        flow: 'checkout',
                        amount: '100',
                        currency: 'USD',

                        intent: 'capture',

                        displayName: 'Display Test',
                        landingPageType: 'login',
                        lineItems: [
                            {
                                quantity: '1',
                                unitAmount: '50.00',
                                name: 'Test Name',
                                kind: 'debit'
                            },
                            {
                                quanity: '1',
                                unitAmount: '50.00',
                                name: 'Test Name 2',
                                kind: 'debit'
                            }
                        ],

                        enableShippingAddress: true,
...

If I remove the lineItems property or set如果我删除 lineItems 属性或设置

...
lineItems: []
...

I get no error, so presumably its the way I'm formatting the items.我没有收到任何错误,所以大概是我格式化项目的方式。

Can anyone assist?有人可以帮忙吗?

Thank you!谢谢!

Misspelt 'quantity' in line item 2 as pointed out by @Reynadan in comments. @Reynadan 在评论中指出,第 2 行中的“数量”拼写错误。 Silly mistake, don't know how I didn't spot it.愚蠢的错误,不知道我怎么没发现它。 Many thanks to all.非常感谢大家。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM