Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * - - 1 votes

[Contribution] - USPS Methods


1245 replies to this topic

#1161 ~Kira

  • Community Member
  • 181 posts
  • Real Name:Starlight Design
  • Gender:Female
  • Location:USA

Posted 06 July 2011, 15:14

I have a question for anyone who might know. I have a store running osCommerce Online Merchant v2.2 RC2a and using USPS Methods version 3.0, which is not calculating for international shipping and gives all kinds of funny characters for domestic shipping. I can see there have been a lot of upgraded packages for this contribution. Which one should I use?
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆

#1162 ~Kira

  • Community Member
  • 181 posts
  • Real Name:Starlight Design
  • Gender:Female
  • Location:USA

Posted 08 July 2011, 15:42

Well for anyone else wondering, I installed version 5.2.2 and it works great! Thanks for the contribution : )
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆

#1163 jonesy827

  • Community Member
  • 16 posts
  • Real Name:Michael Jones

Posted 16 July 2011, 17:59

Hi, I'm wondering if there is a way to set a threshold for USPS First Class International? We want to only offer it on items that are 1 pound or less, and only for orders under $50 total.

#1164 hughesca

  • Community Member
  • 133 posts
  • Real Name:Chris Hughes

Posted 05 September 2011, 18:18

Hello there!

Thanks for the great contrib. I've having a few errors that I can't seem to pan out. See below:

Error: Undefined variable: handling_cost
File: includes/modules/shipping/usps.php
Line: 371
 
Error: Undefined index: methods
File: includes/classes/shipping.php
Line: 98
 
Error: Undefined index: module
File: checkout_shipping.php
Line: 211

I'm running OSC 2.3.1. For the first error I look here:

'cost' => ($cost + $handling_cost[0]) * $shipping_num_boxes);

I've verified the handling costs in the database and they are all currently set to 0.00. So I'm not quite sure why it's throwing the error.

Any help would be appreciated!

Peace,
Chris

#1165 kalkal

  • Community Member
  • 92 posts
  • Real Name:Kurt

Posted 03 October 2011, 01:39

Hey!
Ive had USPS Methods up and running for a while now and tonight Im getting errors in the shipping module. The delivery method names have disappeared and the are some strange characters. I removed and reinstalled the module and re-entered my setting but with no luck.

Anyone else having problems with their shipping module?

Kurt

#1166 kalkal

  • Community Member
  • 92 posts
  • Real Name:Kurt

Posted 04 November 2011, 18:41

Is nobody having problems with their shipping module? My shipping module has not been working for over a week. If you use USPS Methods and it is working...or not, can you please reply to this thread.

Kurt

#1167 Escaping

  • Community Member
  • 15 posts
  • Real Name:Art

Posted 10 November 2011, 16:55

Hey Kurt,

Without any version info, not sure. I do recall seeing another poster describing the strange characters in their responses. I don't recall who the poster was, but if you search the forum for just USPS Methods, you'll find him among the first 2 pages.

As a side note, if you're using an older API, USPS is about to stop supporting you in the first quarter of next year anyway. Might be an opportune moment to go ahead and upgrade. USPS has announced they will end support for RATE and RATEV2 APIs March 31st.

#1168 Escaping

  • Community Member
  • 15 posts
  • Real Name:Art

Posted 12 November 2011, 19:48

I had a problem with this contrib not posting to the order total. Rates returned fine, but on the confirmation page and the final order, no shipping was included.

For anyone else experiencing a similar issue, the problem turned out to be the '<' and '>' characters in the USPS return and the formatted display name. (Basically the <sup>, </sup> and <br>). It may be that it was running afoul of one of our security scrubbers. Not sure there.

As a solution, any place I found:

'title' => $title, (there are 4 in all)

I switched it to:

'title' => str_replace(array('<sup>', '</sup>', '®', '™', '<br>'), '', htmlspecialchars_decode($title)),


That solution actually removes the reg mark which some may object to. To leave it, I suspect you'd use:

'title' => str_replace(array('<sup>', '</sup>', '<br>'), '', htmlspecialchars_decode($title)),

I haven't actually tried that.

Removing the <br>, when you're using some of the optional displays such as signature conf or insurance, could prove to be very odd looking when displayed. Again, I din't want all that so it wasn't an issue. Hope that helps someone else out.

Art

#1169 aeroflight

  • Community Member
  • 13 posts
  • Real Name:Wylie Coyote

Posted 14 November 2011, 19:22

For those that are using Amazon checkout you are about to get a rude error.
I've been in contact with amazon checkout support and there is no fix as of this writing. So far no other checkout service has been affected by the change, so please keep this in mind.

I've upgraded from 5.2 to 6.1. 5.2-6.1 will generate the error at amazon checkout. It seems Amazon api is still operating under the old rate card and limited data.

The problem is amazon shipping method only accepts 100 characters.
The error you will receive is as follows:

The order is not valid. Detail: Invalid Cart XML: The content of field DisplayableShippingLabel is longer than maximum allowed. For this field, the maximum allowed length is 100.

DisplayableShippingLabel is only in their API, it is not in OSC. So here is where we need to limit.

What is displayed by OSC usps method 6.1 is:
First-Class Mail® Package
---Delivery Confirmation
---Approximate delivery time from mailing date 1 day $6.30

What Amazon sees is this:
<DisplayableShippingLabel>United States Postal Service&amp;nbsp;&lt;br&gt;0 lbs, 11.36 oz (First-Class Mail Package (---Approx. delivery time 2 Days))</DisplayableShippingLabel>


As you can see this exceeds the 100 character limit and gives no real information.

Amazon suggested I limit the data which can be done. I've posted a few ideas on their official support thread.. The problem is what do we limit it to? The first 100 characters? Could write a perl script to disassemble and reassemble the data on the fly. Does it matter which characters to us as long as we are providing the actual total to process? My other thought is maybe sanitize the xml code for amazon checkout only.
Or amazon could fix their problem... Not likely to happen anytime soon.

#1170 HSMagic

  • Community Member
  • 250 posts
  • Real Name:Gary

Posted 16 November 2011, 11:23

Been working on upgrading this for a few days, always get the same result when I try to install the usps module:

1170 - BLOB column 'set_function' used in key specification without a key length

ALTER TABLE `configuration` CHANGE `configuration_value` `configuration_value` TEXT NOT NULL, CHANGE `set_function` `set_function` TEXT NULL DEFAULT NULL

[TEP STOP]

OSC 2.2 trying to install usps 5.2.2.

Quote

If you are getting a "parse error" when you click edit in the admin OR
your international options with checkboxes are not showing up in the admin,
you may need to use phpMyAdmin to update the database -> configuration TABLE
and CHANGE "set_function" to TEXT from VARCHAR.
Can't do this either... I get the same 1170 error in myphp...

HELP!

#1171 HSMagic

  • Community Member
  • 250 posts
  • Real Name:Gary

Posted 16 November 2011, 11:52

This is what the database table looks like:
CREATE TABLE `configuration` (
  `configuration_id` int(11) NOT NULL auto_increment,
  `configuration_title` varchar(64) NOT NULL default '',
  `configuration_key` varchar(64) NOT NULL default '',
  `configuration_value` varchar(255) NOT NULL default '',
  `configuration_description` varchar(255) NOT NULL default '',
  `configuration_group_id` int(11) NOT NULL default '0',
  `sort_order` int(5) default NULL,
  `last_modified` datetime default NULL,
  `date_added` datetime NOT NULL default '0000-00-00 00:00:00',
  `use_function` varchar(255) default NULL,
  `set_function` varchar(255) default NULL,
  PRIMARY KEY  (`configuration_id`),
  KEY `set_function` (`set_function`)
) TYPE=MyISAM AUTO_INCREMENT=3588 ;
Should there be a KEY for 'set_function'?

#1172 aeroflight

  • Community Member
  • 13 posts
  • Real Name:Wylie Coyote

Posted 17 November 2011, 19:11

View PostHSMagic, on 16 November 2011, 11:52, said:

This is what the database table looks like:
CREATE TABLE `configuration` (
  `configuration_id` int(11) NOT NULL auto_increment,
  `configuration_title` varchar(64) NOT NULL default '',
  `configuration_key` varchar(64) NOT NULL default '',
  `configuration_value` varchar(255) NOT NULL default '',
  `configuration_description` varchar(255) NOT NULL default '',
  `configuration_group_id` int(11) NOT NULL default '0',
  `sort_order` int(5) default NULL,
  `last_modified` datetime default NULL,
  `date_added` datetime NOT NULL default '0000-00-00 00:00:00',
  `use_function` varchar(255) default NULL,
  `set_function` varchar(255) default NULL,
  PRIMARY KEY  (`configuration_id`),
  KEY `set_function` (`set_function`)
) TYPE=MyISAM AUTO_INCREMENT=3588 ;
Should there be a KEY for 'set_function'?

Although i have not seen your previous post, if you are upgrading, the first question is did you remove the old version before upgrading replace files and pushing the install key? Meaning uninstall from the admin windows/modules/shipping/usps edit remove. add new files/edit files and then run install.

Since you are failing in PHP admin, it is more than likely you have the key already and when asked to update, it fails since the key/field already exists elsewhere. In OSC, disable/remove the module. In phpmyadmin search for each function in and more than likely you'll find a duplicate.in your database. Verify and delete duplicate or comment out in the install. Which is an easy work around but may cause you trouble later for upgrading and uninstall.

#1173 dsolutions

  • Community Member
  • 53 posts
  • Real Name:Evan
  • Gender:Male
  • Location:Texas

Posted 22 November 2011, 16:25

using 6.1 does anyone know how to sort from least expensive to most expensive?

#1174 mvanderhoff

  • Community Member
  • 43 posts
  • Real Name:Matt

Posted 01 December 2011, 03:34

I installed USPS 6.1 to a fresh version of OSC2.3.1 but when I go to checkout NOTHING shows for shipping. Any thoughts? Thank you in advance!

Nevermind Got it!

Edited by mvanderhoff, 01 December 2011, 03:40.


#1175 mvanderhoff

  • Community Member
  • 43 posts
  • Real Name:Matt

Posted 01 December 2011, 03:51

Okay so it is now working BUT when I add two small items totally (0.02lbs) USPS wants it to ship USPS Large Priority Flat Rate Box but the items are tiny. Why did it choose this? Do I need to install Dimensional Support?

#1176 rrosenau

  • Community Member
  • 8 posts
  • Real Name:Ross Rosenau
  • Gender:Male
  • Location:Massachusetts

Posted 02 December 2011, 18:09

Is there a way to make insurance an optional choice of the customer? I cannot seem to get it to work and can't find it in this thread.

Thanks!

#1177 gaspower

  • Community Member
  • 410 posts
  • Real Name:JR
  • Gender:Male
  • Location:OR

Posted 03 December 2011, 23:58

Hello,

I am using version 5.2.1 in OSC2.31. I have an issue with it not returning correct rate for Priority Mail for international. My site is returning $90.00, but when I look up the rate on USPS.com, it shows $40.00? Any ideas?

Also, I tried to down load version 6.1, maybe issue solved in it, but it looks like it was zipped on a Mac, and files are empty. Has anyone else had that download issue?

Thanks JR

#1178 mlavanish

  • Community Member
  • 36 posts
  • Real Name:Matt

Posted 30 December 2011, 18:24

View Postmvanderhoff, on 01 December 2011, 03:51, said:

Okay so it is now working BUT when I add two small items totally (0.02lbs) USPS wants it to ship USPS Large Priority Flat Rate Box but the items are tiny. Why did it choose this? Do I need to install Dimensional Support?

I was having similar problems. Be sure to define the flat rate box dimensions accurately in USPS Methods Admin. Small FR Box is 8.625 x 5.375 x 1.625. Medium FR Box is 11 x 8.5 x 8.5, and Large FR Box is 12 x 12 x 8.5. Without the proper dimensions these will not show as options. I made shipments less than 5 lbs. the Small FR Box dimensions, 5-10 Medium, and Large above that.

#1179 TomB01

  • Community Member
  • 44 posts
  • Real Name:Tom Blanchard
  • Location:Atlanta

Posted 06 January 2012, 18:25

WARNING!
Received today in my e-mail:

Quote


Web Tools integrator;

On January 22, 2012, USPS will update domestic shipping services and international pricing and product features. For detailed information on prices and new product features, please reference the Federal Register Notices viewable at http://pe.usps.com/.

Price Change updates will be available in the Web Tools testing environment for integrator access on or around January 6, 2012. The test environment can be accessed, using your production UserID, via the following URL scheme, host and path:
Secure APIs: https://stg-secure.shippingapis.com/ShippingApi.dll
Non-secure APIs: http://stg-production.shippingapis.com/ShippingApi.dll

Please note that the changes below are intended to be backwards compatible, however, may not be depending on how individual programs are integrated with the APIs.

Web Tools APIs will be affected in the following manner:
· All Web Tools APIs with postage prices incorporated will be updated to reflect the price changes;
· Domestic Rate Calculator API Changes:
  • New <Container> request enumerations added to RateV4 to support the USPS product offerings and prices listed in the Federal Register Notice:

* FLAT RATE BOX (Express Mail Flat Rate Box),

* REGIONALRATEBOXC (Priority Mail Regional Rate Box C);

  • New <FirstClassMailType> request enumeration added to RateV4:

* PACKAGE SERVICE;

  • Optional <ReturnServiceInfo> tag added to RateV4 to return “Loss Guarantee Only” commitment information when an Express Mail Commitment is requested to certain destinations
  • First-Class Mail Package <MailService> response values updated in RateV3 and RateV4 as follows:

* Postage CLASSID="0" - Retail Pricing

<MailService>First-Class Mail® Package</MailService> will become:

<MailService>First-Class Mail® Parcel</MailService>,

* Postage CLASSID="61" - Commercial Pricing

<MailService>First-Class Mail® Package</MailService> will become:

<MailService>First-Class Mail® Package Service</MailService>;

  • New response nodes in RateV3 and RateV4 to support the USPS product offerings and prices listed in the Federal Register Notice (Express Mail Flat Rate Box and Priority Mail Regional Rate Box C, specifically);
  • Rate and RateV2 responses will be modified to:

* Return trademarked product names,

* Enforce dimensional requirements through error messaging for large, oversize and S- restricted destinations.


· All Rate Calculator API integrators are encouraged to migrate to the latest API versions (RateV4, IntlRateV2):
  • Rate and RateV2 versions of the domestic Rate Calculator will be retired on March 31, 2012, requiring all integrators to migrate to the latest versions;

· International Rate Calculator API:
  • New response nodes in IntlRate and IntlRateV2 to support the USPS product offerings and prices listed in the Federal Register Notice (Express Mail Flat Rate Box, specifically);

· Express Mail Label and Hold For Pickup Express APIs:
  • New <Container> request data tags to support the Express Mail Flat Rate Box;

* FLAT RATE BOX


· Delivery Confirmation and Signature Confirmation APIs:
  • New <Container> request data tags to support the Priority Mail Regional Rate Box C;

* REGIONALRATEBOXC


· Express Mail International API:
  • New <Container> request data tags to support the Express Mail Flat Rate Box:

* FLATRATEBOX.



Please contact the USPS Internet Customer Care Center with any questions or concerns at 1-800-344-7779 or uspstechsupport@esecurecare.net.

- Web Tools Program Office

Have any of you experts looked at this? Think it will break things?


EDIT: Tried to clean up the formatting; their bullet list didn't copy-paste well ...

Edited by TomB01, 06 January 2012, 18:34.


#1180 videod

  • Community Member
  • 55 posts
  • Real Name:Dave
  • Gender:Male

Posted 12 January 2012, 21:34

View PostTomB01, on 06 January 2012, 18:25, said:

WARNING!
Received today in my e-mail:



Have any of you experts looked at this? Think it will break things?


EDIT: Tried to clean up the formatting; their bullet list didn't copy-paste well ...
Has anyone been able to sandbox this update? I have tried but failed to see the outcome in PayPal's shipping offering which was nil in their sandbox. Maybe I was doing something wrong?

Edited by videod, 12 January 2012, 21:35.

Production:
osCommerce V2.2 RC2a
PHP Version 5.2.17
MySQL Version 5.0.91-log
Shared Hosting - GoDaddy

----------------------------------------------
Development:
osCommerce 2.3.1 & 3.0.1
CentOS 5.6 / Unbuntu 11.04 / Server 2008 R2
Apache 2.2.3 / 2.2.17
PHP Version 5.3.8
MySQL Version 5.0.77 / 5.0.91 & 5.1.54
Hosted on VMWare Server version 2.0