2

I have built my own custom payment gateway. But how do i get the shipping values in PHP processor?

For example you can get the billing address line 1 using this

$this->param('address1')

How do i get the shipping address1 ?

  • Where are why are you trying to return these? All you really need to do is grab the return data and pass it back on to Store to handle. – Ian May 26 '13 at 17:59
2

Store doesn't actually pass the real shipping address through to the gateway (normally payment gateways don't need to know about the delivery address). If it's required, you could just copy the billing address there. Otherwise, you will need to edit store_payments.php to pass through the shipping details so that you can use them. As you can see in the existing Sage Pay gateways it just uses the billing address.

| improve this answer | |
0

You'll see an example of this in merchant_sagepay_base.php of the merchant lib. On or around line 80 you'll see the request for billing details:

$request['BillingFirstnames'] = $this->param('first_name');

and below a foreach loop for shipping where this is mapped up but Billing is replaced by Delivery:

// shipping details
foreach (array('Firstnames', 'Surname', 'Address1', 'Address2', 'City', 'PostCode',
    'State', 'Country', 'Phone') as $field)
{
    $request["Delivery$field"] = $request["Billing$field"];
}

Just be sure that in that function you're returning the request:

return $request;
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.