Forums / Addon Shipping Modules / USPS Shipping (RESTful) (USPSr)

USPS Shipping (RESTful) (USPSr)

Sticky

Views: 54,964

Results 161 to 180 of 558
24 Aug 2025, 1:20 AM
#161
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

USPS Shipping (RESTful) (USPSr)

retched:

Was this a fresh install or an upgrade?
An upgrade from v1.2.0, which runs without errors.

24 Aug 2025, 2:27 AM
#162
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

siliconbug:

An upgrade from v1.2.0, which runs without errors.

Going to try to work backwards through this. The "easy" fix would be to uninstall 1.3.0 and reinstall 1.3.0 so the module forces the new Configuration keys in. Short of that, I'm trying to get the module to play nice with each version's incoming changes. The unencapsulated version seems to have been skipped with the new keys. I'll have an update posted to the Github and plugin listing in a few moments.

24 Aug 2025, 4:11 AM
#163
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

retched:

Going to try to work backwards through this. The "easy" fix would be to uninstall 1.3.0 and reinstall 1.3.0 so the module forces the new Configuration keys in.
It works, thanks!

Some new options appeared after I uninstall/reinstall 1.3.0, such as:

Attachment 21026

24 Aug 2025, 4:27 AM
#164
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

siliconbug:

It works, thanks!

Some new options appeared after I uninstall/reinstall 1.3.0, such as:

Attachment 21026

Yes. Those three options, the processing class, letter size, and I forget the third off my head, are specifically for the handling of First Class Mail (not to be confused with Ground Advantage, the former First Class Package Service).

24 Aug 2025, 10:51 PM
#165
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

This is an emergency patch to 1.3.0 (there was a breaking change that trashed some unencapsulated installs when they went to upgrade). This patch fixes that and then some.

Added in 1.3.1

  • Added a <label> field to the services list to give people a bigger "target" for selecting services.

Changed in 1.3.1

  • Changed the logic of how upgrade tests and actions are performed. Instead of looking at the newer, more recent versions first, the module will now start with the oldest and go forward.
  • Changed the logic in checking for newer versions of the module. (It should NOT be trying to compare the ZenCart stored version versus 0.0.0, there will ALWAYS be a "newer" version than 0.0.0 there.)

Fixed in 1.3.1

  • Fixed an issue where unencapsulated installs could potentially leave out necessary configuration keys. [#59]
  • Fixed an issue where the retrieved First Class Mail Letters quote would be short by $0.04. [#57]

This zip file includes both the Encapsulated and Non-Encapsulated forms of the module. Please read the directions of the included README.html or README.md to see how to install it and which versions of ZenCart can use which versions.

This version has been submitted to the module directory and will be available on the GitHub shortly.

24 Aug 2025, 10:55 PM
#166
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: USPS Shipping (RESTful) (USPSr)

retched:

This is an emergency patch to 1.3.0 (there was a breaking change that trashed some unencapsulated installs when they went to upgrade). This patch fixes that and then some.

Added in 1.3.1

  • Added a <label> field to the services list to give people a bigger "target" for selecting services.

Changed in 1.3.1

  • Changed the logic of how upgrade tests and actions are performed. Instead of looking at the newer, more recent versions first, the module will now start with the oldest and go forward.
  • Changed the logic in checking for newer versions of the module. (It should NOT be trying to compare the ZenCart stored version versus 0.0.0, there will ALWAYS be a "newer" version than 0.0.0 there.)

Fixed in 1.3.1

  • Fixed an issue where unencapsulated installs could potentially leave out necessary configuration keys. [#59]
  • Fixed an issue where the retrieved First Class Mail Letters quote would be short by $0.04. [#57]

This zip file includes both the Encapsulated and Non-Encapsulated forms of the module. Please read the directions of the included README.html or README.md to see how to install it and which versions of ZenCart can use which versions.

This version has been submitted to the module directory and will be available on the GitHub shortly.
v1.3.1 is now available for download from the Zen Cart Plugins section.

25 Aug 2025, 12:34 AM
#167
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

Overwrite 1.3.0 to 1.3.1, and all shipping modules are killed.
Overwrite 1.3.1 to 1.3.0, and all shipping modules are back.

File Contents( /zc/logs/myDEBUG-adm-20250824-172635-056002.log)
[24-Aug-2025 17:26:35 Canada/Pacific] PHP Parse error: syntax error, unexpected ':', expecting ')' in /includes/modules/shipping/uspsr.php on line 1975

[24-Aug-2025 17:26:35 Canada/Pacific] Request URI: /admindir/index.php?cmd=modules&set=shipping&module=uspsr, IP address: x.x.x.x
--> PHP Parse error: syntax error, unexpected ':', expecting ')' in /includes/modules/shipping/uspsr.php on line 1975.

25 Aug 2025, 12:36 AM
#168
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

siliconbug:

Overwrite 1.3.0 to 1.3.1, and all shipping modules are killed.
Overwrite 1.3.1 to 1.3.0, and all shipping modules are back.

Unencapsulated?

Wait there's nothing near line 1975 that would make that error.

25 Aug 2025, 12:40 AM
#169
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

Yes, ZC 1.5.8a w/ php 7.4

25 Aug 2025, 12:47 AM
#170
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

On 1.3.0:
Attachment 21029

After upgrading to 1.3.1:
Attachment 21030

25 Aug 2025, 12:49 AM
#171
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

siliconbug:

On 1.3.0:
Attachment 21029

After upgrading to 1.3.1:
Attachment 21030

I cannot replicate this on a fresh install of installing 1.3.0 first then 1.3.1.

Can you try removing all of 1.3.0 then going to 1.3.1 fresh instead?

25 Aug 2025, 2:55 AM
#172
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

siliconbug:

Overwrite 1.3.0 to 1.3.1, and all shipping modules are killed.
Overwrite 1.3.1 to 1.3.0, and all shipping modules are back.

facepalm I found it. I have no idea why this is here... but it shouldn't be.

On line 1975: You should see this:

if (!defined(constant_name: 'MODULE_SHIPPING_USPSR_DMST_LETTER_SERVICES')) {

That "constant_name:" bit is NOT supposed to be there.

if (!defined('MODULE_SHIPPING_USPSR_DMST_LETTER_SERVICES')) {

Same with 1988:

if (!defined(constant_name: 'MODULE_SHIPPING_USPSR_INTL_LETTER_SERVICES')) {

Delete that "constant_name:" bit out of there. And if should be:

if (!defined('MODULE_SHIPPING_USPSR_INTL_LETTER_SERVICES')) {

My apologies about this.

25 Aug 2025, 4:03 AM
#173
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

It works now, thank you!

25 Aug 2025, 9:02 AM
#174
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: USPS Shipping (RESTful) (USPSr)

Version 1.3.1 has been removed for now.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

25 Aug 2025, 4:48 PM
#175
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

[This version replaces v1.3.1 due to it being shipped with bad code. This release comes with the patch introduced to the forums. If you installed 1.3.1 while it was available, it's recommended that you uninstall the module from the admin area, if it's active in ZenCart, then overwrite with the contents of this file.]

Combined notes of 1.3.1 and 1.3.2 versions. Version 1.3.1 has been deleted from the ZenCart module directory and deleted from the GitHub repository.

Added in 1.3.1

  • Added a field to the services list to give people a bigger "target" for selecting services.

Changed in 1.3.1

  • Changed the logic of how upgrade tests and actions are performed. Instead of looking at the newer, more recent versions first, the module will now start with the oldest and go forward.
  • Changed the logic in checking for newer versions of the module. (It should NOT be trying to compare the ZenCart stored version versus 0.0.0, there will ALWAYS be a "newer" version than 0.0.0 there.)

Fixed in 1.3.1

  • Fixed an issue where unencapsulated installs could potentially leave out necessary configuration keys. [#59]
  • Fixed an issue where the retrieved First Class Mail Letters quote would be short by $0.04. [#57]

Fixed in 1.3.2

  • Fixed an issue where an unnecessary code hint was causing problems in earlier PHP versions on the 1.3.1 version. That bit has been removed, and VSCode has been given a stern talking to. [#62]
  • Made the four cent change only from 1.3.1 apply only to US shipments as the international rate seems to come through correctly. (There might be a metered toggle later.)

This zip file includes both the Encapsulated and Non-Encapsulated forms of the module. Please read the directions in the included README.html or README.md to see how to install it and which versions of ZenCart are compatible with each version.

This version has been submitted to ZenCart's Module Directory (with apologies to the ZenCart mods/admins and thanks for deleting the old version) and has been publish to the module's repository.

27 Aug 2025, 12:15 PM
#176
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
167
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

It's been a few months since I've been able to get back on to this project to health issues. I am now well enough to march on.
anyways, I've picked up from 1.1.2 version to the latest v 1.3.2 off GitHub tonight.
Hoping to go live with the new USPSr module, however I've ran into a problem again.

Admin side seems to work. I now have a customer key and secret pair to plug in where it's needed.
Customer facing side, does not. During check out of Step 1 of 3 will yield a blank page if any service are selected. But if no services are selected, and the module remains ON, check out step 1 of 3 will load without any quotes or any mention of USPS. As expected, side shows an error of "USPSr Error: No services selected for USPSr module." . Perhaps its running into trouble trying to fetch the quote?

No logs are generated as before in ~/zc/logs . Perhaps php logging might have somehow be muted?

anyways, here is my configuration again.

ZC Version 1.55f
PHP 7.1
MariaDB 11.4.4
original USPS module is installed

As always appreciate looking into this in advance.

27 Aug 2025, 12:27 PM
#177
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: USPS Shipping (RESTful) (USPSr)

During check out of Step 1 of 3 will yield a blank page if any service are selected.

When this happens, a debug log should be produced. Would you please post the log?

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

27 Aug 2025, 1:10 PM
#178
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

swguy:

During check out of Step 1 of 3 will yield a blank page if any service are selected.

When this happens, a debug log should be produced. Would you please post the log?

I concur that there should be an error log somewhere in PHP but luckily I managed to duplicate this. Give me a bit while I dive in. But I now see what caused it.

27 Aug 2025, 1:39 PM
#179
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

Got it!

Seems str_contains was not there in PHP7. (I really have to update my testing environments to use the minimum versions and not the maximums.) Removing that and replacing with the old strpos function, mends this. (I'm close to throwing out older support for PHP7. It has already reached EOL.) That said, I've already pushed two emergency rapid releases this week: I'm going to wait a bit more before pushing this through to ZenCart module DB (it will be available as v0.0.0 on the repository though).

That said, while waiting for the update to go live, patch is as follows:

In /includes/modules/shipping/uspsr.php:

Go to line 2341-2348 (and 2406-2413) and find this:

               [
                    "isPolybagged" => str_contains(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "Polybagged"),
                    "hasClosureDevices" => str_contains(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "ClosureDevices"),
                    "hasLooseItems" => str_contains(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "LooseItems"),
                    "isRigid" => str_contains(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "Rigid"),
                    "isSelfMailer" => str_contains(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "SelfMailer"),
                    "isBooklet" => str_contains(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "Booklet"),
               ],

and replace with this:

               [
                    "isPolybagged" => strpos(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "Polybagged") !== false,
                    "hasClosureDevices" => strpos(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "ClosureDevices") !== false,
                    "hasLooseItems" => strpos(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "LooseItems") !== false,
                    "isRigid" => strpos(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "Rigid") !== false,
                    "isSelfMailer" => strpos(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "SelfMailer") !== false,
                    "isBooklet" => strpos(MODULE_SHIPPING_USPSR_LTR_MACHINEABLE_FLAGS, "Booklet") !== false,
                ],

When making this change, DO NOT FORGOT the extra comma on the last line. This will repair function for PHP 7 and is functionally identical on PHP8. (This change only applies to older ZenCarts.)

27 Aug 2025, 3:35 PM
#180
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
167
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

swguy:

During check out of Step 1 of 3 will yield a blank page if any service are selected.

When this happens, a debug log should be produced. Would you please post the log?

Thats just it, no myDEBUG log files at all. Im wondering if there are some setting in php or something that is mumessages or it's just going out without any errors and debug is set on in the module.