Jump to content
bad_lemming

[Contribution] - USPS Methods

Recommended Posts

If you can't see the USPS module from admin, it's one of two things. You aren't clicking the "install modules" button in upper right hand corner which shows all available modules, or you didn't put the new USPS mod and language files in the correct places, overwriting/replacing the previous files.

Share this post


Link to post
Share on other sites

If you can't see the USPS module from admin, it's one of two things. You aren't clicking the "install modules" button in upper right hand corner which shows all available modules, or you didn't put the new USPS mod and language files in the correct places, overwriting/replacing the previous files.

 

Hmmm.... thanks for getting back to me so quickly. I am clicking the "Install Modules" button under Modules > Shipping, and when that executes, I am not able to edit the available default choices (Rate Table, Flat Rate, etc.) because the frame on the right hand column that pops up that allows me to edit each choice does not pop up.

 

I just re-dropped the 2 usps.php files in their respective directories, after deleting the previous versions completely, and same thing happens.

 

Also have refreshed browsers and cleared cache just to doubly sure. Also wanted to add that the Install Modules button reads (6) next to it, but when it executes, only 3 default choices are there.

 

Any thoughts?

Edited by jsherbanee

Share this post


Link to post
Share on other sites

Ah, ok, so I misunderstood what was happening.

 

Ummm, try removing the usps mod file and language file altogether (set them aside). Then go back in and click install modules. See if that makes a difference. Have to do process of elimination here, cause I'm not sure what it would be, since I've never run into that particular issue.

Share this post


Link to post
Share on other sites

Ok, thanks. Removing those 2 mods got me back to solid ground, and then realized I'm a complete dufus because I left the older usps.php files in the directory in case the installation went sour and had relabeled both as old-usps.php. Once I removed those, I was able to successfully install the module and it works fine. I guess it didn't like having old files in there, even though I wasn't trying to install them.

 

Thanks for your help and thanks for getting back to me so quickly!

Share this post


Link to post
Share on other sites

Ok, thanks. Removing those 2 mods got me back to solid ground, and then realized I'm a complete dufus because I left the older usps.php files in the directory in case the installation went sour and had relabeled both as old-usps.php. Once I removed those, I was able to successfully install the module and it works fine. I guess it didn't like having old files in there, even though I wasn't trying to install them.

 

Thanks for your help and thanks for getting back to me so quickly!

 

Yup, leaving old files in the modules directory will cause problems b/c admin is reading them as mods. Good to know you found the problem rather easily.

Share this post


Link to post
Share on other sites

Well, looks like I spoke too soon. When I click Edit (to Edit the USPS mod settings), the right frame with the edit info disappears. I am able to edit the FedEx mod fine, but editing the USPS one makes the frame with the edit info disappear. :(

Share this post


Link to post
Share on other sites

things were kind of working...the success was spotty

 

then I ran into the problem of the paypal button in 2.3.1 for express not charging shipping...totally skipping the shipping charges...I ate those costs:( IF I USED THE BLUE CHECKOUT BUTTON...shipping would be charged, but quite often this would not even work

 

I came up with some alternatives, but I am still not getting 100% success...it seems random...not sure what is happening

 

3. first I removed the paypal button so no one would get free shipping,

WhatsInMyCart_1303531153025-1.jpg

^removed the button here by adding // before $image_button:

includes/modules/payment/paypal_express.php

 

if (!empty($params)) {
         $image_button .= '&' . implode('&', $params);
       }
     } else {
       //$image_button = MODULE_PAYMENT_PAYPAL_EXPRESS_BUTTON;
     }

2. the "OR" was also removed by going to: includes/languages/english/shopping_cart.php

and finding this: define('TEXT_ALTERNATIVE_CHECKOUT_METHODS', '- OR -');

 

NEXT

I removed text here to clean it up a bit: includes/languages/english/checkout_shipping.php

define('TEXT_ENTER_SHIPPING_INFORMATION', '');

 

ALSO

I changed the error message, but it really doesn't work all of the time

DeliveryInformation_1303536417506.jpg

changed the message here: includes/languages/english/modules/shipping/usps.php

define('MODULE_SHIPPING_USPS_TEXT_ERROR', '<font color="red">An error occurred with the USPS shipping calculations.</font>
<br><font color="blue">Click "Cart" then "Checkout", and the shipping options should load</font></b>');

there was a typo in the original oScommerce 2.3.1 build btw...there was one "r" in occurred

 

I am sure some people just leave the site as the error keeps appearing and they keep going back to cart and hitting checkout again, but no shipping shows, and they can't move forward...

Edited by ErikMM

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

Well, looks like I spoke too soon. When I click Edit (to Edit the USPS mod settings), the right frame with the edit info disappears. I am able to edit the FedEx mod fine, but editing the USPS one makes the frame with the edit info disappear. :(

 

I think you need to do an sql cleanout of the usps configuration entries. I had the exact same thing happen to me last night while working on a payment mod and it was because I had double entries in the sql. Removed them and reinstalled and it worked again. It's probably the same problem with your shipping mod.

Share this post


Link to post
Share on other sites

@ErikMM

 

I'd say that's quite a little mess. I'm surprised you're still having problems.

 

Sporadically not working sounds like a time setting. When doesn't it work? Only at night? If so, it's your time. If not, then..... idk. The new instructions have 2 different options for setting time, in case that's the problem.

 

That PP button in the cart should be abolished and the person who put it there shot. It is absolutely asinine to send somebody to a payment screen BEFORE shipping has been calculated (shall I also mention how utterly distasteful that button is?). That is why it doesn't charge shipping. It is bypassing shipping and going straight to payment. I'm sure somebody has dealt with it and fixed it, but personally, I've never had it in my cart page, so I have no clue how to deal with it if someone wants to leave it there.

 

Why remove the definitions but not remove the actual display from the shopping_cart.php file? You are still displaying it and the link still exists on that page. It's just invisible because the definitions have been removed. Find the link for that button and comment the section out. It'll lighten the page load a little.

 

It seems really odd that one would have to go to cart before going to checkout in order for the mod to work, but you say that even then, it doesn't work all the time. Have you tested other shipping modules?

Share this post


Link to post
Share on other sites

I have/had what I think is a strange problem. USPS stopped working for domestic orders a little after 10:00pm PDT tonight. I'd see the generic "error calculating shipping" error. I did a packet dump and found I was receiving this response:

 

<RateV4Response>
<Package ID="0">
 <Error>
   <Number>-2147219421</Number>
   <Source>DomesticRatesV4;clsRateV4.ValidateShipDate;clsRateV4.CreateSinglePostage-CreateSinglePostage;RateEngineV4.ProcessRequest</Source>
   <Description>Ship Date must be within the next three days.</Description>
   <HelpFile></HelpFile>
   <HelpContext>1000440</HelpContext>
 </Error>
</Package>

<Package ID="1">
 <Error>
   <Number>-2147219421</Number>
   <Source>DomesticRatesV4;clsRateV4.ValidateShipDate;clsRateV4.CreateSinglePostage-CreateSinglePostage;RateEngineV4.ProcessRequest</Source>
   <Description>Ship Date must be within the next three days.</Description>
   <HelpFile></HelpFile>
   <HelpContext>1000440</HelpContext>
 </Error>
</Package>
</RateV4Response>

 

The ShipDate looks like this:

<ShipDate>25-Apr-2011</ShipDate>

 

(at least, I think that's what it looks like - it was all in "%3E%3C" type format, and I never did remember much past %20)

 

I checked another site I run using Zencart, and found it didn't send out a ShipDate, so I edited what's line number 660 in my version of usps.php, commenting out the code that sends the ShipDate:

 

// '<ShipDate>' . date('d-M-Y') . '</ShipDate>' .

(unnecessary whitespace removed in the interest of aesthetics)

 

I would be completely un-flabbergasted if I've missed an announcement somewhere or edited using an old howto, but does this issue make sense to anyone? And, should I attempt to resolve it in some way other than commenting out the ship date (changing the date format, I assume)?

Share this post


Link to post
Share on other sites

It does not make sense at all and I have never had such a problem on my own site. But, I might have a few ideas. It could be that after a certain time in the evening, the post office is expecting the next day's date - although I've never seen that as a problem. If it is, then we need to add a day to the script. Or, it could be that you are sending a date that doesn't match the ship from zip code (At what time did you send the date (April 25) - before or after midnight?). Or, it could be the encoding that you mention. Where did you see the date in encoded format? I assume this is what you saw:

 

%3CShipDate%3E25-Apr-2011%3C/ShipDate%3E

 

But, that is not what should have been sent.

Share this post


Link to post
Share on other sites

It does not make sense at all and I have never had such a problem on my own site. But, I might have a few ideas. It could be that after a certain time in the evening, the post office is expecting the next day's date - although I've never seen that as a problem. If it is, then we need to add a day to the script. Or, it could be that you are sending a date that doesn't match the ship from zip code (At what time did you send the date (April 25) - before or after midnight?). Or, it could be the encoding that you mention. Where did you see the date in encoded format? I assume this is what you saw:

 

%3CShipDate%3E25-Apr-2011%3C/ShipDate%3E

 

But, that is not what should have been sent.

 

It was toward the end of the request:

%3CShipDate%3E25-Apr-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3C%2FRateV4Request%3E

 

The ShipDate was the same as the current date at the time I was attempting to check out - the 25th.

Share this post


Link to post
Share on other sites

I'm an idiot. I need to allow myself to wake up before responding to things.

 

You got that from the packet dump. I didn't read that. The requests are sent in urlencoded format, so what you see there is correct. What we receive back is decoded and doesn't include that garbage. You can get the responses emailed to you using the decode instructions - but those responses don't include what is sent - although they can with a bit of change to the script.

 

If the ship date and your time matched, I don't understand at all why USPS would have a problem with the date.

Not only that, but the date is optional and is ignored for everything except express mail and a select few commercial priority options. From the USPS Rate V4 guide:

 

RateV4Request /

Package /

ShipDate

optional

Date Package Will Be Mailed. Ship date may be today

plus 0 to 3 days in advance. Enter the date in format:

dd-mmm-yyyy, such as 14-Feb-2011.

Example: <ShipDate Option="HFP">01-Feb-

2011</ShipDate>

pattern=\d{2}-[a-zA-z]{3}-\d{4}

 

Scratches head and says WTF.

 

So, did you remove that line, and did it work with the line removed?

Share this post


Link to post
Share on other sites

Hmm, the only domestic shipping options are Media and Priority. International was working, which is another strange thing.

 

When I removed that one line, USPS shipping was once again available, displaying the appropriate options.

Share this post


Link to post
Share on other sites

A solution to Signature Confirmation problem.

 

I had installed USPS Methods 5.2.1 back in March and it worked, and then a couple weeks ago USPS had some price changes. Signature Confirmation was one of those price changes. As a result, Domestic Signature Confirmation no longer worked when over the threshold amount. The customer was no longer charged for Signature Confirmation. I installed USPS Methods 5.2.2 and this did not fix the problem.

 

I opened file /includes/modules/shipping/usps.php and made two edits, which fixed the problem. They are as follows:

 

(1) This mod affects the rate quote.

Find:

 

<\/AvailableOnline><Price>2.35

 

Change to:

 

<\/AvailableOnline><Price>2.45

 

(2) This next mod affects text information in shipping module in the Admin regarding the online price for Signature Confirmation.

Find:

 

'Automatically charge Signature Confirmation when available ($1.95)?',

 

Change to:

 

'Automatically charge Signature Confirmation when available ($2.05)?',

 

These are the only changes I made to the file.

 

To display the correct online price for Signature Confirmation in Admin in edit mode of the shipping module, you have to edit the record, Domestic Signature Confirmation, in the table Configuration in MySql database.

 

I am not a programmer, but it would be nice if these types of changes were not necessary each time USPS changes prices. :)


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

I have just installed this contribution (USPS Methods 5.2.2) in a 2.2 RC2A site. Initially, I incorrectly entered my USPS User ID into the Admin setup screen (I found this out later). and this caused an error the first time I tried a test sale on the production server. I enabled the embedded hook in the catalog/includes/modules/shipping/usps.php script to get a look at the responses from USPS. This identified the problem as a Incorrect User ID Log-In issue, which pointed to my User ID typo error in the Admin setup.

 

Now for problem:

 

After correcting the User ID, I performed a second test purchase, which showed correct USPS quotes on the checkout-shipping screen. At this point it looked like everything was fine. I then checked the USPS Rate Quote and transit response email responses (3), from this last test purchase, which contained the following:

 

 

USPS Rate Quote response:

 

<?xml version="1.0"?>

<RateV4Response><Package ID="0"><ZipOrigination>13324</ZipOrigination><ZipDestination>11787</ZipDestination><Pounds>0</Pounds><Ounces>6.56</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Zone>3</Zone><Postage CLASSID="1"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;</MailService><Rate>5.15</Rate><CommercialRate>4.90</CommercialRate><SpecialServices><SpecialService><ServiceID>9</ServiceID><ServiceName>Certificate of Mailing</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>1.15</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>1.80</Price><PriceOnline>1.80</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>5</ServiceID><ServiceName>Registered Mail&lt;sup&gt;&amp;trade;&lt;/sup&gt;</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>10.75</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>4</ServiceID><ServiceName>Registered without Insurance</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>10.75</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>0</ServiceID><ServiceName>Certified Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>2.85</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>13</ServiceID><ServiceName>Delivery Confirmation&lt;sup&gt;&amp;trade;&lt;/sup&gt;</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.70</Price><PriceOnline>0.00</PriceOnline></SpecialService><SpecialService><ServiceID>7</ServiceID><ServiceName>Return Receipt for Merchandise</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>3.85</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>15</ServiceID><ServiceName>Signature Confirmation&lt;sup&gt;&amp;trade;&lt;/sup&gt;</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>2.45</Price><PriceOnline>2.05</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>5.75</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package><Package ID="1"><ZipOrigination>13324</ZipOrigination><ZipDestination>11787</ZipDestination><Pounds>0</Pounds><Ounces>6.56</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Zone>3</Zone><Postage CLASSID="3"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;</MailService><Rate>16.15</Rate><CommercialRate>15.09</CommercialRate><CommitmentDate>18-May-2011</CommitmentDate><Location>

<CutOff>4:30 PM</CutOff>

<Facility>POST OFFICE</Facility>

<Street>475 MAIN ST</Street>

<City>COLD BROOK</City>

<State>NY</State>

<Zip>13324</Zip>

</Location>

<SpecialServices><SpecialService><ServiceID>11</ServiceID><ServiceName>Express Mail Insurance</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.80</Price><PriceOnline>0.80</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>8</ServiceID><ServiceName>Return Receipt</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>2.30</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>5.75</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package></RateV4Response>

 

 

USPS Transit Response:

<?xml version="1.0"?>

<PriorityMailResponse><OriginZip>133</OriginZip><DestinationZip>117</DestinationZip><Days>2</Days></PriorityMailResponse>

 

 

USPS Transit Response:

<HEAD><TITLE>HTTP Error 400</TITLE></HEAD><BODY><H1>BAD REQUEST</H1><P>Your client sent a request that this server didn't understand.<br>Request:

</body></html>

 

 

The first two email responses seem to be good, while the third is indicating a http error 400. If I hadn't looked at the response emails, I wouldn't have seen this issue. The checkout screen shipping quotes look fine (both UPS Choice and USPS Methods).

 

 

Does anyone have an idea on where I should start, start to track this down.

 

Thanks in advance.

Scott

Share this post


Link to post
Share on other sites

If you website works, and you're getting the quotes, and they are posting to the cart, then there is no need to use the debug or fix anything.

 

We send two types of requests.

 

The first is a "qoute request", which generally gives us the prices for shipping and add on services for each method. This request also gives us the shipping restrictions for international methods. In the case of Express mail, it also sends us a commitment date and drop off locations with cutoff times. We pick it apart and apply what we need to the checkout system.

 

The second is a "transit request", which gives us a transit time for each method.

 

Since USPS is sending Express mail commitments in the first response, we no longer need the commitments from the second response. But, the mod sends a transit request for every shipping method that you accept. In the case of Express mail the request is blank because we don't need the duplicate response. So, what you're seeing is the response to our blank express mail request. Although the script can be changed to skip over, or to change the request on a "per method" basis, it just adds more to a script that's already too long, and it isn't necessary for the functionality of the site.

Share this post


Link to post
Share on other sites

If you want to eliminate those transit response errors, then do this:

 

Find around 650:

				if($transit)
			{
			$transitreq  = 'USERID="' . $Authentication[0] . '">' .
			'<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' .
			'<DestinationZip>' . $dest_zip . '</DestinationZip>';
				switch ($key)
				{
				case 'First-Class Mail':   $transreq[$transid] = 'API=PriorityMail&XML=' . 
					urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
				break;
				case 'Media Mail':   $transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				case 'Parcel Post':   $transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				case 'Priority Commercial': $transreq[$transid] = 'API=PriorityMail&XML=' . 
					urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
				break;
				default:	$transreq[$transid] = '';
				break;
				}
			}

 

Replace with:

 

				if($transit)
			{
			$transitreq  = 'USERID="' . $Authentication[0] . '">' .
			'<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' .
			'<DestinationZip>' . $dest_zip . '</DestinationZip>';
				switch ($key)
				{
				case 'First-Class Mail':   $transreq[$transid] = 'API=PriorityMail&XML=' . 
					urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
				break;
				case 'Media Mail':   $transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				case 'Parcel Post':   $transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				case 'Priority Commercial': $transreq[$transid] = 'API=PriorityMail&XML=' . 
					urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
				break;
				case 'Express Commercial': $transreq[$transid] = 'API=ExpressMailCommitment&XML=' . urlencode( '<ExpressMailCommitmentRequest USERID="' . $Authentication[0] . '"><OriginZIP>' . SHIPPING_ORIGIN_ZIP . '</OriginZIP><DestinationZIP>' . $dest_zip . '</DestinationZIP><Date>' . date('d-M-Y') . '</Date></ExpressMailCommitmentRequest>');
				break;
				default:	$transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				}
			}

 

It won't make any difference to the function, but it will stop the script from sending empty requests and therefore will stop the receipt of response errors.

Share this post


Link to post
Share on other sites

If you want to eliminate those transit response errors, then do this:

 

Find around 650:

				if($transit)
			{
			$transitreq  = 'USERID="' . $Authentication[0] . '">' .
			'<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' .
			'<DestinationZip>' . $dest_zip . '</DestinationZip>';
				switch ($key)
				{
				case 'First-Class Mail':   $transreq[$transid] = 'API=PriorityMail&XML=' . 
					urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
				break;
				case 'Media Mail':   $transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				case 'Parcel Post':   $transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				case 'Priority Commercial': $transreq[$transid] = 'API=PriorityMail&XML=' . 
					urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
				break;
				default:	$transreq[$transid] = '';
				break;
				}
			}

 

Replace with:

 

				if($transit)
			{
			$transitreq  = 'USERID="' . $Authentication[0] . '">' .
			'<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' .
			'<DestinationZip>' . $dest_zip . '</DestinationZip>';
				switch ($key)
				{
				case 'First-Class Mail':   $transreq[$transid] = 'API=PriorityMail&XML=' . 
					urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
				break;
				case 'Media Mail':   $transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				case 'Parcel Post':   $transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				case 'Priority Commercial': $transreq[$transid] = 'API=PriorityMail&XML=' . 
					urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
				break;
				case 'Express Commercial': $transreq[$transid] = 'API=ExpressMailCommitment&XML=' . urlencode( '<ExpressMailCommitmentRequest USERID="' . $Authentication[0] . '"><OriginZIP>' . SHIPPING_ORIGIN_ZIP . '</OriginZIP><DestinationZIP>' . $dest_zip . '</DestinationZIP><Date>' . date('d-M-Y') . '</Date></ExpressMailCommitmentRequest>');
				break;
				default:	$transreq[$transid] = 'API=StandardB&XML=' . 
					urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
				break;
				}
			}

 

It won't make any difference to the function, but it will stop the script from sending empty requests and therefore will stop the receipt of response errors.

 

Thank you for the quick reply. Although the quote response I'm getting back seem to fine, I think I'll perform the change you've suggested, to eliminate the transit response errors. I really appreciate you taking the time to explain the issue. Thanks again.

Share this post


Link to post
Share on other sites

fulluvscents:

 

I have a customer with a modified 2.2-MS2 installation that I need to upgrade to RateV4. Would you please let me know which contribution on the download page is the best one to use?

 

Also, the site is still running on PHP4. Will that version of the contribution run OK on PHP 4?

 

thank you

Share this post


Link to post
Share on other sites

5.2.2 contributed April 7, 2011 is the most recent full package contribution.

 

Since that contribution, there was a change in signature confirmation prices which affected that portion of the module. A fix hasn't been contributed, although it was posted by someone a few posts back in this forum. Unfortunately, I haven't found a way around hardcoding the price into the mod, so until someone does, we'll have to fix price changes as they happen.

 

I don't know of any reasons it won't work on php 4, but I'm running on 5.2.17. I haven't heard any specific cases of either success or problems on php4, but I do know that we had some issues in the beginning where things worked on some servers but not others. I think we've gotten past them all though.

 

Please post if you run into any code compatibility issues though.

Share this post


Link to post
Share on other sites

Dear sir,

 

I try to install a module usps in my website.

 

http://testing.shippingapis.com/ShippingAPITest.dll?API=RateV4&XML=%3CRateV4Request+USERID%3D%22XXXX%22%3E%3CRevision%3E2%3C%2FRevision%3E%3CPackage+ID%3D%220%22%3E%3CService%3EFirst-Class+Mail%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EVARIABLE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%221%22%3E%3CService%3EMedia+Mail%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EVARIABLE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%222%22%3E%3CService%3EParcel+Post%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EVARIABLE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%223%22%3E%3CService%3EPriority+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3E%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%224%22%3E%3CService%3EPriority+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EFLAT+RATE+ENVELOPE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%225%22%3E%3CService%3EPriority+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3ESM+FLAT+RATE+BOX%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%226%22%3E%3CService%3Enone%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3ESM+FLAT+RATE+BOX%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%227%22%3E%3CService%3Enone%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3ESM+FLAT+RATE+BOX%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%228%22%3E%3CService%3EExpress+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3E%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%229%22%3E%3CService%3EExpress+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EFLAT+RATE+ENVELOPE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3C%2FRateV4Request%3E

 

 

But the response of the server test is :

 

<Error>

<Number>80040b1a</Number>

<Description>API Authorization failure. RateV4 is not a valid API name for this protocol.</Description>

<Source>UspsCom::DoAuth</Source>

</Error>

 

What is wrong with it ?

 

Thanks

Share this post


Link to post
Share on other sites

testing.shippingapis.com

 

The test server does not support V4 rate requests. All requests should be sent to the regular server, even if they are test requests.

 

 

 

 

 

Dear sir,

 

I try to install a module usps in my website.

 

http://testing.shippingapis.com/ShippingAPITest.dll?API=RateV4&XML=%3CRateV4Request+USERID%3D%22XXXX%22%3E%3CRevision%3E2%3C%2FRevision%3E%3CPackage+ID%3D%220%22%3E%3CService%3EFirst-Class+Mail%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EVARIABLE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%221%22%3E%3CService%3EMedia+Mail%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EVARIABLE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%222%22%3E%3CService%3EParcel+Post%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EVARIABLE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%223%22%3E%3CService%3EPriority+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3E%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%224%22%3E%3CService%3EPriority+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EFLAT+RATE+ENVELOPE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%225%22%3E%3CService%3EPriority+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3ESM+FLAT+RATE+BOX%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%226%22%3E%3CService%3Enone%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3ESM+FLAT+RATE+BOX%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%227%22%3E%3CService%3Enone%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3ESM+FLAT+RATE+BOX%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%228%22%3E%3CService%3EExpress+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3E%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3CPackage+ID%3D%229%22%3E%3CService%3EExpress+Commercial%3C%2FService%3E%3CFirstClassMailType%3EPARCEL%3C%2FFirstClassMailType%3E%3CZipOrigination%3E77187%3C%2FZipOrigination%3E%3CZipDestination%3E00501%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E12.32%3C%2FOunces%3E%3CContainer%3EFLAT+RATE+ENVELOPE%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CValue%3E43.48%3C%2FValue%3E%3CMachinable%3ETRUE%3C%2FMachinable%3E%3CShipDate%3E06-Jun-2011%3C%2FShipDate%3E%3C%2FPackage%3E%3C%2FRateV4Request%3E

 

 

But the response of the server test is :

 

<Error>

<Number>80040b1a</Number>

<Description>API Authorization failure. RateV4 is not a valid API name for this protocol.</Description>

<Source>UspsCom::DoAuth</Source>

</Error>

 

What is wrong with it ?

 

Thanks

Share this post


Link to post
Share on other sites

I've been working on getting oscommerce set-up on my godaddy hosting account. I installed the version they had available on their site that was an automatic install. After not having the USPS module work and searching the forum for answers I've been installing the USPS Methods 5.2.2 which I assume is what will work with the new USPS updates from what I've seen on the forum. I've gone through all the instructions included with the update download. It looks like things are about to work but I have two different error codes after making the changes.

 

1) When trying to edit any installed module including USPS

 

Fatal error: Call to undefined function tep_cfg_select_option() in /home/content/04/7927404/html/catalog/admin/modules.php(236) : eval()'d code on line 1

 

 

2) When clicking on the Order Total module

 

Parse error: syntax error, unexpected '}', expecting ')' in /home/content/04/7927404/html/catalog/includes/modules/order_total/ot_shipping.php on line 28

 

This is the info around line 28;

class ot_shipping {

var $title, $output;

 

function ot_shipping() {

$this->code = 'ot_shipping';

$this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE;

$this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION;

$this->enabled = ((MODULE_ORDER_TOTAL_SHIPPING_STATUS == 'true') ? true : false);

$this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER;

 

$search = array(' regimark', ' tradmrk');

24

25 $replace = array('<sup>®</sup>', '<sup>™</sup>');

26

27 $this->output[] = array('title' => str_replace($search, $replace, $order->info['shipping_method']) . ':',

28 }

29

30 function process() {

31 global $order, $currencies;

 

 

 

Any help you could give would be terrific!!

 

Jay

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×