[Contribution] - USPS Methods
#1161
Posted 06 July 2011, 15:14
#1162
Posted 08 July 2011, 15:42
#1163
Posted 16 July 2011, 17:59
#1164
Posted 05 September 2011, 18:18
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
Posted 03 October 2011, 01:39
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
Posted 04 November 2011, 18:41
Kurt
#1167
Posted 10 November 2011, 16:55
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
Posted 12 November 2011, 19:48
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
Posted 14 November 2011, 19:22
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&nbsp;<br>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
Posted 16 November 2011, 11:23
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
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.
HELP!
#1171
Posted 16 November 2011, 11:52
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
Posted 17 November 2011, 19:11
HSMagic, on 16 November 2011, 11:52, said:
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
Posted 22 November 2011, 16:25
#1174
Posted 01 December 2011, 03:34
Nevermind Got it!
Edited by mvanderhoff, 01 December 2011, 03:40.
#1175
Posted 01 December 2011, 03:51
#1176
Posted 02 December 2011, 18:09
Thanks!
#1177
Posted 03 December 2011, 23:58
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
Posted 30 December 2011, 18:24
mvanderhoff, on 01 December 2011, 03:51, said:
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
Posted 06 January 2012, 18:25
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
Posted 12 January 2012, 21:34
TomB01, on 06 January 2012, 18:25, said:
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 ...
Edited by videod, 12 January 2012, 21:35.
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














