OsCommerce – SagePay Form Error – 3144: The Delivery information is required
I’ve recently installed Sagepay Form on a clients shopping cart, which is powered by osCommerce Version 2.2.
The installation was pretty simple. I had to install the osCommerce SagePay Form Module and then do various other things to get the account live.
Once the account was live I stumbled upon quite a serious problem. The problem was that SagePay REQUIRES a delivery address to be posted to Sagepay’s secure server before it will process a payment. However, if you’re selling downloadable products (e.g. e-books) a delivery address isn’t required, and consequently isn’t posted to Sagepay’s server and you’re returned with the following error:
Status: MALFORMED
Status Detail: 3144 : The Delivery information is required.
I assumed there would be a setting somewhere either in osCommerce or the Sagepay form module that allows you to send the “Billing Address” instead of the “delivery address” if it doesn’t exist. But apparently not. or at least I couldn’t find the solution in Google.
I searched high and low for a solution for this, but I couldn’t find anything online. Surely someone else must have had this problem before. ANYONE? SOMEONE?
Anyways, I decided to stop wasting my time looking for a solution and work on my own solution. I looked at the SagePay Form Module file and pretty quickly found a solution.
Required file: online store dir/includes/modules/payment/sage_pay_form.php
Here is the original code from line 130:
1 2 3 4 5 6 7 | $crypt['BillingPhone'] = substr($order->customer['telephone'], 0, 20); $crypt['DeliverySurname'] = substr($order->delivery['lastname'], 0, 20); $crypt['DeliveryFirstnames'] = substr($order->delivery['firstname'], 0, 20); $crypt['DeliveryAddress1'] = substr($order->delivery['street_address'], 0, 100); $crypt['DeliveryCity'] = substr($order->delivery['city'], 0, 40); $crypt['DeliveryPostCode'] = substr($order->delivery['postcode'], 0, 10); $crypt['DeliveryCountry'] = $order->delivery['country']['iso_code_2']; |
I replaced that with the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | $crypt['BillingPhone'] = substr($order->customer['telephone'], 0, 20); if(!empty($order->delivery['street_address']) || !empty($order->delivery['postcode'])) { $crypt['DeliverySurname'] = substr($order->delivery['lastname'], 0, 20); $crypt['DeliveryFirstnames'] = substr($order->delivery['firstname'], 0, 20); $crypt['DeliveryAddress1'] = substr($order->delivery['street_address'], 0, 100); $crypt['DeliveryCity'] = substr($order->delivery['city'], 0, 40); $crypt['DeliveryPostCode'] = substr($order->delivery['postcode'], 0, 10); $crypt['DeliveryCountry'] = $order->delivery['country']['iso_code_2']; } else { $crypt['DeliverySurname'] = substr($order->billing['lastname'], 0, 20); $crypt['DeliveryFirstnames'] = substr($order->billing['firstname'], 0, 20); $crypt['DeliveryAddress1'] = substr($order->billing['street_address'], 0, 100); $crypt['DeliveryCity'] = substr($order->billing['city'], 0, 40); $crypt['DeliveryPostCode'] = substr($order->billing['postcode'], 0, 10); $crypt['DeliveryCountry'] = $order->billing['country']['iso_code_2']; } |
So what the code is basically doing is checking to see if the customers delivery address OR postcode is empty. If either of fields
are empty, it posts the billing address to SagePay instead.
The slight modification resolved the problem. I can now process payments using SagePay for downloadable products that don’t have a delivery address.
Has anyone else had this problem? Has anyone else come up with a better solution?




brightcherry.co.uk
Hey thanks for this. I have been looking for a solution to a similar problem, but with zen Cart which is much the same. Problem is I’m having difficulty in getting it to work for my zen cart SagePay Form module. It should work but I’m a little stupid when it comes to php code.
Hiya,
for others who might be experiencing a similar problem to this when sending a country value for billing/delivery:
sagepay requires a country code for the country – not a country name, so France would be FR, etc… I’m having a similar problem myself, but I’m having trouble finding a dropdown-list of all the codes!!
:S
Hope you solved your problem though!
– beth