【发布时间】:2021-02-04 06:47:00
【问题描述】:
我正在制作一个电子商务网站,该网站应该允许使用智能结帐按钮进行 Paypal 付款。 我担心每个人都可以 Curl 我的网站,获取原始 HTML+js 页面并编辑购买单位值。一旦他们完成了他们可以运行网页,js代码将被执行,按钮被渲染为假值,他们可以伪造付款(用更少的钱)。 真的吗?是否有任何解决方案仍在使用智能按钮(不使用 REST API)?
我无法手动创建按钮,因为会有很多不同用户出售的文章。
paypal.Buttons({
// Set up the transaction
createOrder: function(data, actions) {
var o = actions.order.create({
purchase_units: [{
amount: {
value: '30.99' //Can users change this ?
},
payee: {
email_address: 'sb-qloys3515897@business.example.com'//email of the sellers
}
}]
})
return o;
},
// Finalize the transaction
onApprove: function(data, actions) {
console.log(details);
return actions.order.capture().then(function(details) {
// Show a success message to the buyer
//alert('Transaction completed by ' + details.payer.name.given_name + '!');
alert(details);
});
}
}).render('#paypal-button-container');
【问题讨论】:
标签: paypal paypal-sandbox