0

I have set up a query string to pass info through to paypal and all work fine apart from the address override feature. It will not automatically update the delivery address with the new one posted from the form.

I want to be able to override for both existing and new accounts

The code is as follows:

$queryString  = "?cmd=_xclick";
        $queryString .= "&upload=1";
        $queryString .= "&charset=utf-8";
        $queryString .= "&currency_code=GBP";
        $queryString .= "&business=loyal_1326448684_biz@sowebdesign.com";
        $queryString .= "&return=http://groupon.english-sofas.co.uk/english-groupon/groupon-success.php";
        $queryString .= "&notify_url=http://groupon.english-sofas.co.uk/english-groupon/paypal-groupon-ipn.php";
        $queryString .= "&item_name= $itemname";
        $queryString .= "&item_number= $id";
        $queryString .= "&amount=$delivery";
        $queryString .= "&custom=$grouponcode";


        $queryString .= "&address_override=true";
        $queryString .= "&first_name=$fname";
        $queryString .= "&last_name=$lname";
        $queryString .= "&address_street=$add1";
        $queryString .= "&address_city=$city";
        $queryString .= "&address_zip=$post";
        $queryString .= "&address_country=$country";



$paypalstring = "https://sandbox.paypal.com/cgi-bin/web-scr" . $queryString;
gen_Eric
  • 223,194
  • 41
  • 299
  • 337
meohmy
  • 131
  • 7
  • 17
  • I suggest instead of building the query string this way, using [`http_build_query`](http://php.net/manual/en/function.http-build-query.php). It'll make sure everything's escaped/encoded properly. `$queryString = '?'.http_build_query(array('cmd'=>'xclick', 'upload' => 1))`. – gen_Eric Jan 13 '12 at 15:50

3 Answers3

2

I'm not sure where you found "address_street", "address_city", but these are not correct.
The correct parameters are listed on "HTML Variables for Filling Out PayPal Checkout Pages Automatically" in https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables

Robert
  • 19,326
  • 3
  • 58
  • 59
1

You have to use address_override=1 instead of address_override=true and the field names address1/city/zip/country instead of address_street/address_city/address_zip/address_country

Christian d'Heureuse
  • 5,090
  • 1
  • 32
  • 28
0

If you want the forms input not to be overriden with the client's account value, then you have to post address_override=0 ! not true (nor 1)

JLuc
  • 333
  • 5
  • 15