【问题标题】:Returning customer information from Paypal Client Side REST Integration Button从 Paypal 客户端 REST 集成按钮返回客户信息
【发布时间】:2018-04-20 12:35:31
【问题描述】:

我正在通过 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!');
 });

谢谢

【问题讨论】:

    标签: rest paypal paypal-rest-sdk paypal-buttons


    【解决方案1】:

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

    onAuthorize: function(data, actions) {
    
        return actions.payment.execute().then(function(payment) {
            console.log(payment.payer.payer_info);
        });
    }
    

    【讨论】:

      猜你喜欢
      • 2016-05-10
      • 2021-09-04
      • 1970-01-01
      • 2013-06-27
      • 2014-05-30
      • 1970-01-01
      • 2018-06-19
      • 1970-01-01
      • 2019-08-11
      相关资源
      最近更新 更多