Forums / Addon Payment Modules / Beanstream or CP Shipping Module? 64 Character Limit

Beanstream or CP Shipping Module? 64 Character Limit

Started by blackthorne on 5 Oct 2010, 11:28 AM · Views: 7,787

Results 21 to 25 of 25
17 May 2012, 7:37 PM
#21
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Beanstream or CP Shipping Module? 64 Character Limit

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),
23 Oct 2012, 5:04 PM
#22
dix30simulation avatar

dix30simulation

New Zenner

Join Date:
Aug 2012
Location:
Montreal, Canada
Posts:
30
Plugin Contributions:
0

Re: Beanstream or CP Shipping Module? 64 Character Limit

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.

23 Oct 2012, 7:17 PM
#23
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Oct 2012, 8:01 PM
#24
dix30simulation avatar

dix30simulation

New Zenner

Join Date:
Aug 2012
Location:
Montreal, Canada
Posts:
30
Plugin Contributions:
0

Re: Beanstream or CP Shipping Module? 64 Character Limit

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

23 Oct 2012, 8:47 PM
#25
dix30simulation avatar

dix30simulation

New Zenner

Join Date:
Aug 2012
Location:
Montreal, Canada
Posts:
30
Plugin Contributions:
0

Re: Beanstream or CP Shipping Module? 64 Character Limit

ruffendz:

Figured it all out...its all about the brakets and closing the open code!
:clap:

What do you mean?