sanbornm / ups-php

Automatically exported from code.google.com/p/ups-php
MIT License
8 stars 11 forks source link

Shipping API: 125000 Missing or invalid shipment digest #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use CentOS6
2. send ShippingAcceptRequest

What is the expected output? What do you see instead?
Expected: Successful request and GIF Label
I see: UPS Hard Error: [125000] Missing or invalid shipment digest.

What version of the product are you using? On what operating system?
CentOS 5/6, Perl 5.8.8, PHP 5.3.10 (Joomla + Virtuemart)

On CentOS 5 everything worked fine, but when we upgraded to 6 we couldn't make 
any successful ShippingAcceptRequests to generate shipping label. Response was 
always "Missing or invalid shipment digest".

After some digging in ups-php I've found that line 55 in class.ups.php ie 

$output = preg_replace('/[\s+]{2,}/', '', $xml);

was causing this. I believe that is related to the way how Perl in CentOS6 is 
handling reg. expressions, but this somehow could be fixed in ups-php.

I've spent over 5 hours looking for this...

Original issue reported on code.google.com by woodzu123 on 4 May 2012 at 5:08

GoogleCodeExporter commented 9 years ago
I solved this issue............please follow instructions below...

After some digging in ups-php I've found that line 55 in class.ups.php ie 

replace this line 
$output = preg_replace('/[\s+]{2,}/', '', $xml);

with the below line

$output = $xml;

Original comment by atiqmumt...@gmail.com on 12 Dec 2012 at 12:53

GoogleCodeExporter commented 9 years ago
Thanks for this solution.

Replacing 
$output = preg_replace('/[\s+]{2,}/', '', $xml);

with
$output = $xml;

Solved the problem for me too. It seems we had the same problem after an 
upgrade in some of our linux servers.

Again, thank yout very much.

Original comment by jdavid.z...@gmail.com on 31 May 2013 at 4:39