【问题标题】:Get address before execute payment with Paypal RestAPI在使用 Paypal Rest API 执行付款之前获取地址
【发布时间】:2016-04-30 22:16:40
【问题描述】:

我刚刚使用 RestAPI 和以下 SDK 示例完成了我的 paypal 付款。

首先(获取发送客户的贝宝网址) https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/CreatePaymentUsingPayPal.php

最后(为授权客户返回我的服务器的 url) https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/ExecutePayment.php

在最后的cmet中,是关于根据送货地址增加费用的信息,但我不知道如何获得。

// ### Optional Changes to Amount
// If you wish to update the amount that you wish to charge the customer,
// based on the shipping address or any other reason, you could
// do that by passing the transaction object with just `amount` field in it.
// Here is the example on how we changed the shipping to $1 more than before.

顺便说一下,我执行支付时只得到客户的地址,然后我得到支付的对象为$result->payer

$result = $payment->execute($execution, $apiContext);

在根据客户的地址执行检查运费之前如何获得付款人?

谢谢。

【问题讨论】:

    标签: php paypal


    【解决方案1】:

    在回答我的问题时,位于 var $payment 中的对象在执行付款之前具有地址和所有用户数据。

    $payment = Payment::get($paymentId, $apiContext);
    print_r($payment);
    

    【讨论】:

      猜你喜欢
      • 2013-07-04
      • 2017-05-13
      • 2014-04-15
      • 2014-12-08
      • 2016-09-02
      • 2016-03-07
      • 2017-07-13
      • 2016-02-21
      • 2013-08-29
      相关资源
      最近更新 更多