2016-01-24 117 views
0

我剛剛使用RestAPI和以下SDK示例完成了我的PayPal付款。使用PayPal執行付款之前獲取地址RestAPI

優先(獲取發送客戶的貝寶URL) https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/CreatePaymentUsingPayPal.php

末(返回鏈接到我的授權客戶服務器) https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/ExecutePayment.php

在最後的意見,是有關增加更多的成本信息根據送貨地址,但我不知道如何得到。

// ### 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->付款人

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

我怎樣才能得到付款人在根據客戶的地址執行檢查運輸成本之前?

謝謝。

回答

0

在回答我的問題時,位於var $ payment中的對象在執行付款前有地址和所有用戶數據。

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