odd_duck
odd_duck

Reputation: 4101

PayPal Express Checkout - hide shipping address

I am using PayPal Express Checkout (Payflow) on my store. My checkout journey looks like:

  1. Shopping Basket
  2. Delivery Address and Option
  3. Payment Option (Paypal or card)

On stage 3, if the user chooses Paypal i need to hide viewing and being able to change the shipping address within Paypal as i already define them a step before.

My request is like so when i redirect my page to paypal:

$paypal_query_array = array(
    'USER'       => $user,
    'VENDOR'     => $vendor,
    'PARTNER'    => $partner,
    'PWD'        => $password,
    'TENDER'     => 'P',
    'TRXTYPE'    => 'S', 
    'ACTION'     => 'S',
    'AMT'        => $_SESSION['cost'],
    'CURRENCY'   => $currency,
    'CANCELURL'  => $cancel_url,
    'RETURNURL'  => $return_url,
    'INVNUM'     => $_SESSION['invoice'],
    'ORDERDESC'  => $description,
    'NOSHIPPING' => 1,
    'ADDROVERRIDE' => 0
);

foreach ($paypal_query_array as $key => $value) {
    $paypal_query[]= $key.'['.strlen($value).']='.$value;
}

$paypal_query=implode('&', $paypal_query);
$nvpArray = fetch_data($unique_id, $submiturl, $paypal_query);

if($nvpArray['RESPMSG']=='Approved') {
    $payPalURL = $PayPalURL.urldecode($nvpArray["TOKEN"]);
    header('Location: '.$payPalURL);
}

I assumed that NOSHIPPING and ADDOVERRIDE would allow this but i still get a shipping address and ability to change on the paypal page.

Upvotes: 0

Views: 701

Answers (1)

Drew Angell
Drew Angell

Reputation: 26036

NOSHIPPING will completely remove shipping altogether. ADDROVERRIDE would use whatever address you pass in the SetExpressCheckout request and not allow the buyer to change it.

So it sounds like ADDROVERRIDE is what you're wanting, but you're not passing any address in the request, so I'm a little confused by that.

Upvotes: 1

Related Questions