[PayPal智能按钮/ v2 API的JS客户端:如何设置付款方式和覆盖品牌名称?

问题描述 投票:0回答:1

无法确定如何以及在何处将1.payment_method设置为“ IMMEDIATE_PAYMENT_REQUIRED”,覆盖2.brand_name(贝宝帐户上卖方的默认名称)和3.getan发票ID (order_id)批准。

我有以下JavaScript客户端/ v2 API PayPal代码,除了我要设置/获取的这3个新变量之外,它们都能正常工作。

paypal.Buttons({
                    style: {
                        color: 'gold',
                        shape: 'pill',
                        height: 40
                    },
                    commit: true,
                    createOrder: function (data, actions) {
                        return actions.order.create({

                            purchase_units: [{
                                    amount: {
                                        value: 20.00
                                    },
                                    description: 'My company',
                                    invoice_id: '234567890',
                                    soft_descriptor: 'mysite.com'
                                }]
                        });
                    },
                    onApprove: function (data, actions) {
                        return actions.order.capture().then(function (details) {
                            var name = details.payer.name.given_name;
                            alert('Transaction completed by ' + name);
                        });
                    }
                }).render('#paypal-button-container');
paypal paypal-sandbox paypal-rest-sdk paypal-buttons
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.