【发布时间】:2017-08-02 04:16:49
【问题描述】:
下面是从
复制的 checkout.js 脚本将其修改为使用“生产”而不是“沙盒”,并粘贴在我们通过登录创建的 LiveAPI 密钥中,转到 Dashboard/Rest API 应用程序。
本网站的设立是为了收取会议的注册费。用户在 HTML 表单上输入信息,然后将用户发送到显示欠款总额的另一个页面。这是我插入结帐脚本的页面。
结果:页面上会显示一个 paypal 按钮,点击后将用户连接到 paypal。显示我们组织的电子邮件地址(不是用户的电子邮件);用户必须更改此设置,然后可以登录他们的个人 PayPal 帐户或输入信用卡信息。
问题:当用户完成交易时,他们会返回到包含结帐的页面,而不是传递到我们在 PayPal 注册的结果页面。此外,我们的帐户没有显示任何交易记录(无论是在沙盒中还是在 Live 中)。它在仪表板中报告为“失败的交易”
https://developer.paypal.com/developer/applications/
几天前将这个问题发到support@paypal-techsupport.com,但至今没有收到任何回复。
任何帮助将不胜感激!
开始代码
<div id="paypal-button"></div>
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script>
paypal.Button.render({
env: 'production', // Specify 'sandbox' for the test environment
// env: 'sandbox', // Specify 'sandbox' for the test environment
client: {
// sandbox:
production: 'xxxxx'
},
payment: function() {
var env = this.props.env;
var client = this.props.client;
return paypal.rest.payment.create(env, client, {
transactions: [
{
amount: { total: <?echo $Fees?>, currency: 'USD' }
}
]
});
},
// Set up the payment here, when the buyer clicks on the button
commit: true, // Optional: show a 'Pay Now' button in the checkout flow
onAuthorize: function(data, actions) {
// Execute the payment here, when the buyer approves the transaction
}
}, '#paypal-button');
</script>
结束代码
【问题讨论】:
标签: javascript paypal