从Paypal客户端REST集成按钮返回客户信息

从Paypal客户端REST集成按钮返回客户信息,rest,paypal,paypal-rest-sdk,paypal-buttons,Rest,Paypal,Paypal Rest Sdk,Paypal Buttons,我正在使用checkout.js()使用“客户端REST集成” 一旦授权且paypal窗口关闭,是否有办法返回客户信息(姓名+电子邮件地址) 也许在下面的某个地方 onAuthorize: function(data, actions) { // Make a call to the REST api to execute the payment return actions.payment.execute().then(function() { window.aler

我正在使用checkout.js()使用“客户端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);
    });
}