我正在查看 PayPal 互动集成演示链接。
在用户完成支付流程后的某个时刻,客户端会触发此代码:
// onAuthorize() is called when the buyer approves the payment
onAuthorize: function(data, actions) {
// Make a call to the REST api to execute the payment
return actions.payment.execute().then(function() {
window.alert('Payment Complete!');
});
}
在实际场景中,我可能不想只是弹出一个警告,而是希望向服务器发送指令以发货或更新用户计划。这通常会通过HTTP POST请求完成。
那么服务器如何知道确实有付款,并且这不是黑客手动发送http post请求的结果呢?