php - Get address before execute payment with Paypal RestAPI -


i made paypal payments using restapi , following examples of sdk.

first (get paypal url send customer) https://github.com/paypal/paypal-php-sdk/blob/master/sample/payments/createpaymentusingpaypal.php

last (returning url server authorized customer) https://github.com/paypal/paypal-php-sdk/blob/master/sample/payments/executepayment.php

in comments of last, info add more cost based on shipping address, don't know how get.

// ### optional changes amount // if wish update amount wish charge customer, // based on shipping address or other reason, // passing transaction object `amount` field in it. // here example on how changed shipping $1 more before. 

by way, address of customer when execute payment, payed object $result->payer

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

how can payer before executing check shipping cost based on address of customer?.

thanks.

in reply of question, object located in var $payment have address , user data before payment executed.

$payment = payment::get($paymentid, $apicontext); print_r($payment); 

Comments