I\'m trying to implement the API
of PayPal payment
with Laravel 5.1
. But when I log in to PayPal (sandbox)
, it uses the addre
I think this is the relevant documentation you are looking for.
For people who already have PayPal accounts and whom you already prompted for a shipping address before they choose to pay with PayPal, you can use the entered address instead of the address the person has stored with PayPal.
Instead of using the address saved in their account,
The payer is shown the passed-in address but cannot edit it. No address is shown if the address is invalid, such as missing required fields like country, or if the address is not included at all.
Edit: Try something like this in place of what you have.
$address = new ShippingAddress();
$address->setCity('Toronto');
$address->setState('ON');
$address->setCountryCode('CA');
$address->setLine1('123 Fake Street');
$address->setPostalCode('M1M1M1');
$payerInfo = new PayerInfo();
$payerInfo->setShippingAddress($address);
$payer = new Payer();
$payer->setPaymentMethod('paypal');