我正在通过 checkout.js ( https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/client-side-REST-integration/ ) 使用“客户端 REST 集成”
一旦授权并且 paypal 窗口关闭,有没有办法返回客户的信息(姓名 + 电子邮件地址)?
也许在下面的某个地方?
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!');
});
谢谢
最佳答案
我自己回答: actions.payment.execute().then() 返回一个包含此信息的支付对象
onAuthorize: function(data, actions) {
return actions.payment.execute().then(function(payment) {
console.log(payment.payer.payer_info);
});
}
关于rest - 从 Paypal 客户端 REST 集成按钮返回客户信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47169279/