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

USPS Shipping (RESTful) (USPSr)

Sticky

Views: 54,964

Results 461 to 480 of 558
24 Feb 2026, 5:44 PM
#461
retched avatar

retched

Totally Zenned

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

USPS Shipping (RESTful) (USPSr)

njcyx:

Ok. I just uploaded all the new files to the server. It looks like under the folder /zc_plugins/USPSRestful, there are two folders. One is v1.7.0, another is v1.8.1. So it doesn't overwrite the old files...

I commented out the bottom section in usps.extra_functions.php and it worked. My PHP version is 8.2

Yeah, that's exactly what I ended up doing (deleting it in my case). I think a change meant for the PHP5 release (for ZC 1.5.4 and below) snuck its way in.

Fast tracking this again. (Thankfully 1.8.1 or 1.8.0 didn't get approved in ZC yet.) Will take me 20 minutes.

24 Feb 2026, 5:46 PM
#462
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
374
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

Thanks as always. It is not urgent since there is an easy walkaround solution. You can leave it for your next version update.

24 Feb 2026, 7:51 PM
#463
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)

Minor bugfix pass submitted. (Changes were submitted as an omnibus combine to the Plugin Directory.)

Fixed in 1.8.2

  • Fixed a white screen crash caused by the redeclaration of zen_draw_label that was meant for the PHP5 version of module. [#117]

These changes were posted to the GitHub and were submitted to the Plugins Directory as well.

26 Feb 2026, 4:57 AM
#464
siliconbug avatar

siliconbug

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

Not sure if USPS changes something, but I start to get this error:
(Same error on v1.6.2 - v1.8.2)

PHP Warning: Undefined array key "extraService" in /zc158/includes/modules/shipping/uspsr.php on line 668.
26 Feb 2026, 12:08 PM
#465
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:

Not sure if USPS changes something, but I start to get this error:
(Same error on v1.6.2 - v1.8.2)

PHP Warning: Undefined array key "extraService" in /zc158/includes/modules/shipping/uspsr.php on line 668.


I'll look at this later today
26 Feb 2026, 12:57 PM
#466
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:

Not sure if USPS changes something, but I start to get this error:
(Same error on v1.6.2 - v1.8.2)

PHP Warning: Undefined array key "extraService" in /zc158/includes/modules/shipping/uspsr.php on line 668.


Need the debug log if possible?
26 Feb 2026, 2:39 PM
#467
siliconbug avatar

siliconbug

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

[25-Feb-2026 21:21:30 Canada/Pacific] Request URI: /index.php?main_page=shopping_cart, IP address: x.x.x.x, Language id 1
#0 /zc158/includes/modules/shipping/uspsr.php(668): zen_debug_error_handler()
#1 /zc158/includes/classes/shipping.php(201): uspsr->quote()
#2 /zc158/includes/modules/shipping_estimator.php(151): shipping->quote()
#3 /zc158/includes/templates/bootstrap/templates/tpl_shopping_cart_default.php(229): require('/zc...')
#4 /zc158/includes/templates/bootstrap/common/tpl_main_page.php(233): require('/zc...')
#5 /zc158/index.php(94): require('/zc...')
--> PHP Warning: Undefined array key "extraService" in /zc158/includes/modules/shipping/uspsr.php on line 668.

I also receive an email from USPS today:

02/26/2026
USPS APIs Outage Notification

USPS APIs is experiencing an intermittent outage to the oauth2/v3/,  payments/v3/,subscriptions-tracking/v3/ and /tracking/v3 APIs. Support teams are currently investigating and will provide an update as soon as possible. We apologize for any inconvenience.
26 Feb 2026, 2:43 PM
#468
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:

[25-Feb-2026 21:21:30 Canada/Pacific] Request URI: /index.php?main_page=shopping_cart, IP address: x.x.x.x, Language id 1
#0 /zc158/includes/modules/shipping/uspsr.php(668): zen_debug_error_handler()
#1 /zc158/includes/classes/shipping.php(201): uspsr->quote()
#2 /zc158/includes/modules/shipping_estimator.php(151): shipping->quote()
#3 /zc158/includes/templates/bootstrap/templates/tpl_shopping_cart_default.php(229): require('/zc...')
#4 /zc158/includes/templates/bootstrap/common/tpl_main_page.php(233): require('/zc...')
#5 /zc158/index.php(94): require('/zc...')
--> PHP Warning: Undefined array key "extraService" in /zc158/includes/modules/shipping/uspsr.php on line 668.

> 
> I also receive an email from USPS today:
> ```
02/26/2026
USPS APIs Outage Notification

USPS APIs is experiencing an intermittent outage to the oauth2/v3/,  payments/v3/,subscriptions-tracking/v3/ and /tracking/v3 APIs. Support teams are currently investigating and will provide an update as soon as possible. We apologize for any inconvenience.

Of course it does. NIX THIS!

Have to do a deep dive on this.

26 Feb 2026, 3:08 PM
#469
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:

[25-Feb-2026 21:21:30 Canada/Pacific] Request URI: /index.php?main_page=shopping_cart, IP address: x.x.x.x, Language id 1
#0 /zc158/includes/modules/shipping/uspsr.php(668): zen_debug_error_handler()
#1 /zc158/includes/classes/shipping.php(201): uspsr->quote()
#2 /zc158/includes/modules/shipping_estimator.php(151): shipping->quote()
#3 /zc158/includes/templates/bootstrap/templates/tpl_shopping_cart_default.php(229): require('/zc...')
#4 /zc158/includes/templates/bootstrap/common/tpl_main_page.php(233): require('/zc...')
#5 /zc158/index.php(94): require('/zc...')
--> PHP Warning: Undefined array key "extraService" in /zc158/includes/modules/shipping/uspsr.php on line 668.

> 
> I also receive an email from USPS today:
> ```
02/26/2026
USPS APIs Outage Notification

USPS APIs is experiencing an intermittent outage to the oauth2/v3/,  payments/v3/,subscriptions-tracking/v3/ and /tracking/v3 APIs. Support teams are currently investigating and will provide an update as soon as possible. We apologize for any inconvenience.

For this particular error/warning, I need the USPSr Debug log. I need to see what the api is dumping out.

26 Feb 2026, 3:23 PM
#470
siliconbug avatar

siliconbug

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

Getting worse.
I notice that I can't open the Shipping setting page to turn on the log this morning.

Request URI: /admin/index.php?cmd=modules&set=shipping, IP address: x.x.x.x, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 /zc158/includes/functions/plugin_support.php(58): strcmp()
#2 /zc158/includes/modules/shipping/uspsr.php(2228): plugin_version_check_for_updates()
#3 /zc158/includes/modules/shipping/uspsr.php(235): uspsr->adminInitializationChecks()
#4 /zc158/admin/modules.php(187): uspsr->__construct()
#5 /zc158/admin/index.php(11): require('/zc...')
--> PHP Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /zc158/includes/functions/plugin_support.php on line 58.

But Estimate Shipping Costs on store front still shows.

26 Feb 2026, 4:57 PM
#471
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:

Getting worse.
I notice that I can't open the Shipping setting page to turn on the log this morning.

Request URI: /admin/index.php?cmd=modules&set=shipping, IP address: x.x.x.x, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 /zc158/includes/functions/plugin_support.php(58): strcmp()
#2 /zc158/includes/modules/shipping/uspsr.php(2228): plugin_version_check_for_updates()
#3 /zc158/includes/modules/shipping/uspsr.php(235): uspsr->adminInitializationChecks()
#4 /zc158/admin/modules.php(187): uspsr->__construct()
#5 /zc158/admin/index.php(11): require('/zc...')
--> PHP Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /zc158/includes/functions/plugin_support.php on line 58.

> 
> But Estimate Shipping Costs on store front still shows.

.... HUH? I'll look into this.
26 Feb 2026, 5:19 PM
#472
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)

retched:

.... HUH? I'll look into this.

This looks like it was a failure to connect to the ZenCart plugin database for an update check as the strcmp happens in plugin_support.php which is not my file.

26 Feb 2026, 5:37 PM
#473
brian70809 avatar

brian70809

New Zenner

Join Date:
Jun 2011
Posts:
85
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

Just started getting this today..

Using V1.70. I'll upgrade today..
Zen Cart 2.1

[26-Feb-2026 11:33:28 America/Chicago] Request URI: /index.php?main_page=checkout_one, IP address: 64.56.17.94, Language id 1
#0 /zc_plugins/USPSRestful/v1.7.0/catalog/includes/modules/shipping/uspsr.php(675): zen_debug_error_handler()
#1 /includes/classes/shipping.php(257): uspsr->quote()
#2 /includes/modules/pages/checkout_one/header_php.php(220): shipping->quote()
#3 /index.php(35): require('...')
--> PHP Warning: Undefined array key "extraService" in /zc_plugins/USPSRestful/v1.7.0/catalog/includes/modules/shipping/uspsr.php on line 675.

26 Feb 2026, 5:38 PM
#474
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)

brian70809:

Just started getting this today..

Using V1.70. I'll upgrade today..
Zen Cart 2.1

[26-Feb-2026 11:33:28 America/Chicago] Request URI: /index.php?main_page=checkout_one, IP address: 64.56.17.94, Language id 1
#0 /zc_plugins/USPSRestful/v1.7.0/catalog/includes/modules/shipping/uspsr.php(675): zen_debug_error_handler()
#1 /includes/classes/shipping.php(257): uspsr->quote()
#2 /includes/modules/pages/checkout_one/header_php.php(220): shipping->quote()
#3 /index.php(35): require('...')
--> PHP Warning: Undefined array key "extraService" in /zc_plugins/USPSRestful/v1.7.0/catalog/includes/modules/shipping/uspsr.php on line 675.

You are the second person that happened to. Not sure if this is a thing 1.8.2 will fix. Something changed about the output from the API. I'll need to go through and fix this.

26 Feb 2026, 8:29 PM
#475
swguy avatar

swguy

Administrator

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

Re: USPS Shipping (RESTful) (USPSr)

Bug in 1.8.2:

[26-Feb-2026 14:21:25 America/Chicago] Request URI: /store/index.php?main_page=checkout_shipping, IP address: 47.205.202.45, Language id 1
#0 /home/client/public_html/store/includes/modules/shipping/uspsr.php(668): zen_debug_error_handler()
#1 /home/client/public_html/store/includes/classes/shipping.php(245): uspsr->quote()
#2 /home/client/public_html/store/includes/modules/pages/checkout_shipping/header_php.php(185): shipping->quote()
#3 /home/client/public_html/store/index.php(35): require('/home/client...')
--> PHP Warning: Undefined array key "extraService" in /home/client/public_html/store/includes/modules/shipping/uspsr.php on line 668.

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.

26 Feb 2026, 8:33 PM
#476
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
374
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

My walkaround/temp fix for "extraService" warning.

At line 668, change from

$lookup[$name]['extraService'][$svc['extraService']] = $svc;

to

$lookup[$name]['extraService' ?? ""][$svc['extraService'] ?? ""] = $svc;

No further warning, at least for half a day...

26 Feb 2026, 9:19 PM
#477
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)

njcyx:

My walkaround/temp fix for "extraService" warning.

At line 668, change from

$lookup[$name]['extraService'][$svc['extraService']] = $svc;

to

$lookup[$name]['extraService' ?? ""][$svc['extraService'] ?? ""] = $svc;

No further warning, at least for half a day...

I'm a little cautious about doing that as the name of the service is being used as an index for the name of the add on service. I'll go over this but I'm not sure why this is coming up on that particular version. I'm definitely going to need to see USPS debug logs because I need to see what is coming from USPS.

26 Feb 2026, 9:32 PM
#478
swguy avatar

swguy

Administrator

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

Re: USPS Shipping (RESTful) (USPSr)

I'm definitely going to need to see USPS debug logs because I need to see what is coming from USPS.

Just sent.

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.

26 Feb 2026, 11:45 PM
#479
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)

Update for everyone, found the "degenerate" service that's breaking everything: "Registered Mail COD Charge" is not assigned a code when returning through the API. So for example:

{
            "totalBasePrice": 33.25,
            "rates": [
                {
                    "description": "Priority Mail Express Flat Rate Envelope",
                    "priceType": "RETAIL",
                    "price": 33.25,
                    "weight": 0.299999999999999988897769753748434595763683319091796875,
                    "dimWeight": 0,
                    "fees": [
                    ],
                    "startDate": "2026-01-18",
                    "endDate": "",
                    "mailClass": "PRIORITY_MAIL_EXPRESS",
                    "zone": "05",
                    "productName": "Priority Mail Express Flat Rate Envelope",
                    "productDefinition": "1-2 day specific guaranteed delivery by 6:00pm local delivery time",
                    "processingCategory": "FLATS",
                    "rateIndicator": "E4",
                    "destinationEntryFacilityType": "NONE",
                    "SKU": "DEFE0XXXXR00700"
                }
            ],
            "extraServices": [
              ... snipped ...
             {
                    "name": "Registered Mail COD Charge",
                    "priceType": "RETAIL",
                    "price": 9.0999999999999996447286321199499070644378662109375,
                    "warnings": [
                    ],
                    "SKU": "DXGX0XCXXRX0000"
                },
                {
                    "extraService": "940",
                    "name": "Registered Mail",
                    "priceType": "RETAIL",
                    "price": 20.39999999999999857891452847979962825775146484375,
                    "warnings": [
                    ],
                    "SKU": "DXGX0XXXXRX0100"
                },


            ]
        },
}

What's effectively happening is that for some reason, USPS API decided to return the Registered Mail COD Charge for certain services. I do not know why or how this is even applied. I'll look this up later this evening.

To squelch the error, for now, I suggest the post from njcyx:

njcyx:

My walkaround/temp fix for "extraService" warning.

At line 668, change from

$lookup[$name]['extraService'][$svc['extraService']] = $svc;

to

$lookup[$name]['extraService' ?? ""][$svc['extraService'] ?? ""] = $svc;

No further warning, at least for half a day...

That seems to work for now. I'll go ahead and try to come up with a better solution. My apologies to the ZenCart mod team who (this weekend) had to quickly go through four of my edits. (The last one, v1.8.2, was approved just recently.)

26 Feb 2026, 11:56 PM
#480
siliconbug avatar

siliconbug

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

v1.8.2 also causes another error on ZC 1.5.8 w/ php 8.2:

Request URI: /shEet-CCW-clIff/index.php?cmd=modules&set=shipping, IP address: x.x.x.x, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 /zc158/includes/classes/db/mysql/query_factory.php(667): trigger_error()
#2 /zc158/includes/classes/db/mysql/query_factory.php(634): queryFactory->show_error()
#3 /zc158/includes/classes/db/mysql/query_factory.php(275): queryFactory->set_error()
#4 /zc158/includes/modules/shipping/uspsr.php(2212): queryFactory->Execute()
#5 /zc158/includes/modules/shipping/uspsr.php(235): uspsr->adminInitializationChecks()
#6 /zc158/admin/modules.php(187): uspsr->__construct()
#7 /zc158/admin/index.php(11): require('/zc...')
--> PHP Fatal error: 1062:Duplicate entry 'uspsrUninstall' for key 'page_key' :: INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('uspsrUninstall', 'BOX_USPSR_UNINSTALLER', 'FILENAME_USPS_UNINSTALL', '', 'tools', 'Y', 600) ==> (as called by) /zc158/includes/modules/shipping/uspsr.php on line 2212 <== in /zc158/includes/classes/db/mysql/query_factory.php on line 667.

The normal screen w/ 1.6.2 or 1.7.0:
Attachment 21182

The abnormal screen w/ 1.8.x:
Attachment 21183