1

我正在使用 checkout.js 的“客户端 REST 集成”(https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/client-side-REST-integration/

一旦授权并且贝宝窗口关闭,有没有办法返回客户的信息(姓名+电子邮件地址)?

也许在下面的某个地方?

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!');
 });

谢谢

4

1 回答 1

1

为自己回答:actions.payment.execute().then() 返回带有此信息的付款对象

onAuthorize: function(data, actions) {

    return actions.payment.execute().then(function(payment) {
        console.log(payment.payer.payer_info);
    });
}
于 2017-11-07T23:53:01.950 回答