Search code examples
phpcakephppaypal-ipn

How to send Shipping address to Paypal, when using Paypal IPN


I am trying to integrate Paypal IPN to an application which I am developing. And I am stuck in a problem which is regarding shipping address. I need to know how to send the address variables to Paypal, as a request so that User can see that address on paypal. Please tell me the variables which should be sent to paypal, which paypal treats as shipping address(or delivery address).


Solution

  • To send the shipping address to PayPal you need to modify your PayPal submit form.

    Using this will let you to override PayPal stored address:

    <input type="hidden" name="address_override" value="1">
    

    And then use this variables to override PayPal stored address:

    <input type="hidden" name="first_name" value="Spendthrift">
    <input type="hidden" name="last_name" value="Richer">
    <input type="hidden" name="address1" value="123 Money St">
    <input type="hidden" name="city" value="Dollarwood">
    <input type="hidden" name="state" value="AB">
    <input type="hidden" name="zip" value="4811">
    <input type="hidden" name="country" value="CA">
    

    From PayPal.com

    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.

    Here are the references:
    https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/#id08A6F0T0JQN