PayPal API with Laravel - Updating of data

前端 未结 4 676
囚心锁ツ
囚心锁ツ 2021-02-14 10:51

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

4条回答
  •  礼貌的吻别
    2021-02-14 11:42

    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.

提交回复
热议问题