-
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.
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Please let us know the status of your testing. Thanks!
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Brilliant! That solved my problem too!! Thank you very much!!!
:smile:
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Hello ... I'm getting the same error. I've followed your instructions and changed the two strings in beanstream.php:
'shippingMethod' => substr($order->info['shipping_method'], 0, 30)
but I'm still getting this error:
Shipping method must be less than 64 characters
- Your INTERAC® card could not be authorized for this reason. Please correct the information and try again or contact us for further assistance.
I'm using version 1.3.9g and the Canada Post module. Site is located at www.mysocksrock.ca. The error doesn't occur when using the "Walk in" shipping method.
Any ideas how to fix this? Is it possible to change to 128 chars?
Thanks in advance,
Chris
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Okay, i fixed this. In /includes/classes/order.php I changed the following (line 614):
'shipping_method' => $this->info['shipping_method'],
TO
'shipping_method' => substr($order->info['shipping_method'], 0, 30),
This was in addition to the change suggested by swguy above.
Chris
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Hello...i have updated both files so that my code currently looks like this in /includes/modules/payment/beanstream.php:
Code:
$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()
);
And My code looks like this in /includes/classes/order.php after I changed the recomended line 614:
Code:
'shipping_method' => substr($order->info['shipping_method'], 0, 30),
And i still get the error message:
•Shipping method must be less than 64 characters
- Your INTERAC® card could not be authorized for this reason. Please correct the information and try again or contact us for further assistance.
I am Lost and dont know what else to change unless someone can see something that i am missing. Your help is greatly apprecated!
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Figured it all out...its all about the brakets and closing the open code!
:clap:
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
This is how i solved the issue on my site. Go to \includes\modules\payment\beanstream.php and replace line of 656 to line 702 with the below code however I did not change the \includes\classes\order.php. Changing that file caused additional errors.
$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
Hello All,
I just had a call from a customer flagging this 64 character issue....I made the change to my beanstream.php file, uploaded it and now my beanstream module has disappeared from the admin and any order that used beanstream is a blank page. I tried reverting back to the original file and everything is still blank. Has anyone bumped into this or can someone please recommend a solution?
Any help is appreciated. Thank you.
Paul
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Quote:
Originally Posted by
kcb410
Hello All,
I just had a call from a customer flagging this 64 character issue....I made the change to my beanstream.php file, uploaded it and now my beanstream module has disappeared from the admin and any order that used beanstream is a blank page. I tried reverting back to the original file and everything is still blank. Has anyone bumped into this or can someone please recommend a solution?
Any help is appreciated. Thank you.
Paul
Sorry Guys...panicked. I just downloaded the original file set and replaced my beanstream.php file and everything is okay.
-
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);
Hello Everyone,
Does anyone know if this fix still works with Zen 139h? I notice it's a couple of years old.
I've tried it a couple of times and when I try to process a payment I just get a blank page.
Any help or comment would be appreciated. Thank you!
Zen 139h
PHP Version: 5.3.10
MySQL 5.0.95
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Quote:
Originally Posted by
kcb410
Hello Everyone,
Does anyone know if this fix still works with Zen 139h? I notice it's a couple of years old.
I've tried it a couple of times and when I try to process a payment I just get a blank page.
Any help or comment would be appreciated. Thank you!
Zen 139h
PHP Version: 5.3.10
MySQL 5.0.95
To answer my own question....
This works fine if you open your \includes\modules\payment\beanstream.php and replace this @ lines 338 thru 343:
'shippingMethod' => $order->info['shipping_method']);
} else {
$shipping_data = array();
}
$extra_data = array(
'shippingMethod' => $order->info['shipping_method'],
with this:
'shippingMethod' => substr($order->info['shipping_method'], 0, 30));
} else {
$shipping_data = array();
}
$extra_data = array(
'shippingMethod' => substr($order->info['shipping_method'], 0, 30),
-
1 Attachment(s)
Re: Beanstream or CP Shipping Module? 64 Character Limit
Quote:
Originally Posted by
chrispritchard
Okay, i fixed this. In /includes/classes/order.php I changed the following (line 614):
'shipping_method' => $this->info['shipping_method'],
TO
'shipping_method' => substr($order->info['shipping_method'], 0, 30),
Chris
ERrr...do you have V1.50?
As I still get the same error for any product required for shipping by Post Canada Module. If I select a downloadable product, then all is fine.
I tried everything
This is what I have:
beanstream.php:
'shippingMethod' => substr($order->info['shipping_method'], 0, 30));
} else {
$shipping_data = array();
}
$extra_data = array(
'shippingMethod' => substr($order->info['shipping_method'], 0, 30),
Order.php
'shipping_method' => substr($order->info['shipping_method'], 0, 30),
Still get this!
Attachment 11347
Any idea?
thank you for your help...
This was in addition to the change suggested by swguy above.
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Something must be wrong in your beanstream module code.
The CP module only passes its info back to the store. The beanstream module just takes what it gets back. The code changes discussed above specifically chop that to just 30 characters.
So ... if you're getting errors that say it must be less than 64 characters, that means your code changes aren't right.
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Quote:
Originally Posted by
DrByte
Something must be wrong in your beanstream module code.
The CP module only passes its info back to the store. The beanstream module just takes what it gets back. The code changes discussed above specifically chop that to just 30 characters.
So ... if you're getting errors that say it must be less than 64 characters, that means your code changes aren't right.
I Would have really love to so will have been able to update and have it working but this must be something else. All returns to normal when I unsintall the CP module so it clearly comes from it. Without Beanstream Interac needs, CP module works great.
The beanstream code is as is above and tried the different scenario:
1: Beanstream.php updated / order.php Original
2: Beanstream.php original / order.php Updated
3: Beanstream.php updated / order.php Updated
When processing a product that requires shipping, I get the "64 caracteres message Error with option 1
When processing a product that requires shipping, I get the "64 caracteres message Error with option 2
When processing a product that requires shipping, I get the "64 caracteres message Error with option 3
When processing a product that requires shipping, I get a HTTP500 Error with option 3 with CP module OFF
-
Re: Beanstream or CP Shipping Module? 64 Character Limit
Quote:
Originally Posted by
ruffendz
Figured it all out...its all about the brakets and closing the open code!
:clap:
What do you mean?