Canada Post Shipping Module

Getting a lot of php errors - Canada Post Shipping Module

Getting a lot of php errors

by gsmiley007 » Wed Jan 03, 2024 6:12 pm

Hi
Just wondering if something changed with canada post?

Error from cURL: Error Code: 9111
Error Msg: No services are appropriate for the shipment of the defined parcel. Validate the parcel criteria against product specifications.

experienced by customer with id 0 on 2024-01-03 13:08:42
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Contact:

Re: Getting a lot of php errors

by zipurman » Wed Jan 03, 2024 7:07 pm

I have not heard of any issues until now. What are the PHP errors? As the above show an API error on data supplied.

I can have a look this weekend.
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact:

Re: Getting a lot of php errors

by gsmiley007 » Thu Jan 04, 2024 3:32 pm

I couldn't find any php error logs. not sure where they would be located. But i'm getting a lot of these curl error messages.
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Contact:

Re: Getting a lot of php errors

by zipurman » Fri Jan 05, 2024 4:08 am

I just did some testing and I am not getting any errors from the Canada Post API.

Looking at their error pages:

Error 9111

No services are appropriate for the shipment of the defined parcel. Validate the parcel criteria against product specifications.

A Get Rates request was unable to return any price quotes because the shipment characteristics such as weight or dimensions were outside of the service selected or outside of all possible services. If a specific service was selected, remove the selection or choose a different service.

https://www.canadapost-postescanada.ca/ ... tables.jsf

Make sure the product size and weight does not exceed what is expected by their API. Let me know if you solve the issue and I can add some extra option to handle those errors differently once I know what your issue was.
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact:

Re: Getting a lot of php errors

by zipurman » Fri Jan 05, 2024 7:37 am

I did get an error via email log showing:

Error from cURL: Error Code: Server
Error Msg: /rs/ship/price: cvc-simple-type 1: element {http://www.canadapost.ca/ws/ship/rate}postal-code of type {http://www.canadapost.ca/ws/ship/rate}PostalCodeType may not be empty

experienced by customer with id 0 on 2024-01-04 22:05:15


So their API must have changed recently. Will do some testing to see what I can do.

Please let me know shipment size weight locations pieces for your error so I can test.
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact:

Re: Getting a lot of php errors

by gsmiley007 » Sat Jan 06, 2024 7:08 am

I use 0.1 for the weight
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Contact:

Re: Getting a lot of php errors

by gsmiley007 » Sat Jan 06, 2024 5:50 pm

origin city/province/country/postal filled out. Handling %, tax class none, shipping zone none, yes to CP errors by email
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Contact:

Re: Getting a lot of php errors

by zipurman » Sun Jan 07, 2024 4:50 pm

Okay, in the file: includes/modules/shipping/zipcanadapost.php

Add the following before

Code: Select all

$curl = curl_init( $url );

Code: Select all

if ( $_SERVER['REMOTE_ADDR'] == 'your.ip.address.here' ) {
    var_dump($xmlRequest);
}
Make sure to update your.ip.address.here to your IP that you are visiting the site FROM.
Then load the shipping estimate for your shipment.
Copy/Paste the XML you are sending and I will have a look.
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact:

Re: Getting a lot of php errors

by gsmiley007 » Thu Jan 11, 2024 5:49 am

string(608) " counter 2024-01-18COV 60.010 1 1 1 K2G5N3 K2C3G9 "
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Contact:

Re: Getting a lot of php errors

by zipurman » Thu Jan 11, 2024 6:05 am

Something wrong there as the output should be a bunch of xml.
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact: