gpt4 book ai didi

php - PayPal Express Checkout.js - 发送自定义参数

转载 作者:可可西里 更新时间:2023-11-01 00:18:43 25 4
gpt4 key购买 nike

我如何将自定义参数发送到新的 Paypal Express 结账。我需要发送 booking_id 并在成功全额付款后获得相同的信息。

我已经通过paypal官方了document , 但找不到我们如何发送?

请看下面是我的文件代码:

<!DOCTYPE html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
</head>
<body>
<div id="paypal-button-container"></div>
<script>
paypal.Button.render({
env: 'sandbox', // sandbox | production
client: {
sandbox: 'AYbCnvobq09Ptmsd1TRp3019CMrSTyaAmrHNv6ox0jl86H9OZFmGCPqHqqfPtqpTYTiIuy_e5UGnclMw',
//production: '<insert production client id>'
},
commit: true,
payment: function(data, actions) {
return actions.payment.create({
payment: {
transactions: [
{
amount: { total: '0.01', currency: 'USD' }
}
]
}
});
},
onAuthorize: function(data, actions) {
return actions.payment.execute().then(function() {
window.alert('Payment Complete!');
});
}
}, '#paypal-button-container');
</script>
</body>

最佳答案

我已经解决了问题,我们可以在支付方式中传递参数。像下面的代码:

payment: function(data, actions) {
return actions.payment.create({
payment: {
transactions: [
{
amount: { total: '10', currency: 'USD' },
custom: '1452'
}
]
}
});
},

希望这对开发者有所帮助。

关于php - PayPal Express Checkout.js - 发送自定义参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44923951/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com