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 haven't worked with PayPal very much, but I'm taking this from the official documentation, so I'm confident it will work for you. Overriding addresses stored with PayPal. For a list of available variables you can use in the checkout page, see Auto-fill PayPal checkout page variables.
Or, from inside your script...
$address = new ShippingAddress();
$address->setCity('Montreal');
$address->setState('QC');
$address->setCountryCode('CA');
$address->setLine1('345 Lark Ave');
$address->setPostalCode('H1A4K2');
$payerInfo = new PayerInfo();
$payerInfo->setShippingAddress($address);
Here's the list of available province codes. You would use these two-letter strings for the "state" variable, just like you would a U.S. state. PayPal State and Province codes
Province name | Province code
Alberta |
AB
British Columbia |
BC
Manitoba |
MB
New Brunswick |
NB
Newfoundland and Labrador |
NL
Northwest Territories |
NT
Nova Scotia |
NS
Nunavut |
NU
Ontario |
ON
Prince Edward Island |
PE
Quebec |
QC
Saskatchewan |
SK
Yukon |
YT
I hope this helps you.