Beanstream or CP Shipping Module? 64 Character Limit
Hey guys...
Just had one transaction get refused by Beanstream. Error is as follows:
Quote:
Shipping method must be less than 64 characters
- Your credit card could not be authorized for this reason. Please
correct the information and try again or contact us for further
assistance.
So it turns out that the shipping option he has selected is:
Quote:
Canada Post (1 box(es)) (Domestic Lettermail: estimated 2-4 business days):
OBVIOUSLY more than 64 characters...
Problem is I can't find where that is being generated. In my "/includes/languages/english/modules/shipping/canadapost.php"
I have already changed:
define('MODULE_SHIPPING_PACKAGING_RESULTS', ' box(es) to be shipped');
to:
define('MODULE_SHIPPING_PACKAGING_RESULTS', ' box(es)');
And I can't find any reference to this or a "Letter" module component in the Beasnstream payment module.
Any help directing me to where the shipping description is generated greatly appreciated!
Re: Beanstream or CP Shipping Module? 64 Character Limit
In ./includes/modules/payment/beanstream.php, try changing the two references to
$order->info['shipping_method']
to (say)
substr($order->info['shipping_method'], 0, 30);
Re: Beanstream or CP Shipping Module? 64 Character Limit
OK..I found the line but am code-weak and am not sure how to add what you suggested.
What I change it to:
Code:
'shipName' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
'shipAddress1' => $order->delivery['street_address'],
'shipAddress2' => $order->delivery['suburb'],
'shipCity' => $order->delivery['city'],
'shipProvince' => $province_code_ship,
'shipPostalCode' => $order->delivery['postcode'],
'shipCountry' => $order->delivery['country']['iso_code_2'],
'substr($order->info['shipping_method'], 0, 30);
Original
Code:
'shipName' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
'shipAddress1' => $order->delivery['street_address'],
'shipAddress2' => $order->delivery['suburb'],
'shipCity' => $order->delivery['city'],
'shipProvince' => $province_code_ship,
'shipPostalCode' => $order->delivery['postcode'],
'shipCountry' => $order->delivery['country']['iso_code_2'],
'shippingMethod' => $order->info['shipping_method'];
Is this how it's supposed to look?
Re: Beanstream or CP Shipping Module? 64 Character Limit
When I make the code changes I get this error:
Quote:
Parse error: syntax error, unexpected '(', expecting ')' in /home/neitarms/public_html/includes/modules/payment/beanstream.php on line 338
in the administrator back end, Payment module page. Only three Authorize.net modules load, all the rest don't load.
This is my line 338:
Quote:
'substr'($order->info['shipping_method'], 0, 30);
Re: Beanstream or CP Shipping Module? 64 Character Limit
No, you should have replaced ONLY EXACTLY what swguy told you, not the entire line.
Re: Beanstream or CP Shipping Module? 64 Character Limit
OK. I just replaced the code, not the whole line.
Still get the same error:
Quote:
Parse error: syntax error, unexpected ';', expecting ')' in /home/neitarms/public_html/includes/modules/payment/beanstream.php on line 338
Here is the code as it looks now:
Code:
if (isset($order->delivery['street_address']) && $order->delivery['street_address'] != '') {
$shipping_data = array(
// 'deliveryEstimate' => $order->delivery['shipping_method'],
'shipName' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
'shipAddress1' => $order->delivery['street_address'],
'shipAddress2' => $order->delivery['suburb'],
'shipCity' => $order->delivery['city'],
'shipProvince' => $province_code_ship,
'shipPostalCode' => $order->delivery['postcode'],
'shipCountry' => $order->delivery['country']['iso_code_2'],
'shippingMethod' => substr($order->info['shipping_method'], 0, 30);
} else {
$shipping_data = array();
}
$extra_data = array(
'shippingMethod' => substr($order->info['shipping_method'], 0, 30),
'trnComments' => 'Website Order', // $order->info['comments'],
// Additional Merchant-defined variables go here
'ref1' => $_SESSION['customer_id'],
'ref2' => $order_time,
'ref3' => zen_get_ip_address(),
'ref4' => $sessID,
'customerIp' => zen_get_ip_address()
);
Re: Beanstream or CP Shipping Module? 64 Character Limit
The first changed line you have
'shippingMethod' => substr($order->info['shipping_method'], 0, 30);
change to:
'shippingMethod' => substr($order->info['shipping_method'], 0, 30)
);
Re: Beanstream or CP Shipping Module? 64 Character Limit
OK. I used Dreamweaver to figure out the error.
Line needed to be:
Quote:
substr($order->info['shipping_method'], 0, 30));
Was missing bracket.
Code that lets me load the page is now:
Code:
if (isset($order->delivery['street_address']) && $order->delivery['street_address'] != '') {
$shipping_data = array(
// 'deliveryEstimate' => $order->delivery['shipping_method'],
'shipName' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
'shipAddress1' => $order->delivery['street_address'],
'shipAddress2' => $order->delivery['suburb'],
'shipCity' => $order->delivery['city'],
'shipProvince' => $province_code_ship,
'shipPostalCode' => $order->delivery['postcode'],
'shipCountry' => $order->delivery['country']['iso_code_2'],
'shippingMethod' => substr($order->info['shipping_method'], 0, 30));
} else {
$shipping_data = array();
}
$extra_data = array(
'shippingMethod' => substr($order->info['shipping_method'], 0, 30),
'trnComments' => 'Website Order', // $order->info['comments'],
// Additional Merchant-defined variables go here
'ref1' => $_SESSION['customer_id'],
'ref2' => $order_time,
'ref3' => zen_get_ip_address(),
'ref4' => $sessID,
'customerIp' => zen_get_ip_address()
);
Will update after testing this evening.
Thanks folks!
Re: Beanstream or CP Shipping Module? 64 Character Limit
Quote:
Originally Posted by
swguy
In ./includes/modules/payment/beanstream.php, try changing the two references to
$order->info['shipping_method']
to (say)
substr($order->info['shipping_method'], 0, 30);
Thanks!
Can you tell me what this actually does? LOL
:D
Re: Beanstream or CP Shipping Module? 64 Character Limit
Sends only the first 30 characters of the shipping method.