verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

AusPost shipping methods stopped working #69

Closed ax2000 closed 3 years ago

ax2000 commented 3 years ago

Hi there, A client just reported that the AusPost shipping methods stopped appearing on the checkout flow of their website. I've tried to do some debugging but I can't figure out what the issue might be.

It was working correctly up until now and nothing within the Postie settings had been updated, so not sure if something might have changed on AusPost's side?

Things I've tried/tested:

The API connection status in the Postie CP appears as Not Connected and when hitting refresh I get the error below (which from memory it used to connect correctly when I set it up originally)

Screen Shot 2021-07-20 at 17 09 01

Additional info

Additional context My postie.php looks like:

return [
    '*' => [
        'pluginName' => 'Shipping Providers',
        'hasCpSection' => true,
        'enableCaching' => true,
        'displayDebug' => false,
        'displayErrors' => false,
        'manualFetchRates' => false,
        'fetchRatesPostValue' => 'postie-fetch-rates',
        'providers' => [
          'australiaPost' => [
            'name' => 'AusPost',
            'enabled' => true,

            // API Settings
            'settings'   => [
                'apiKey' => 'xxxxxxxxxxxxxxxxxxx',
            ],

            // Mark-Up
            'markUpRate' => '',
            'markUpBase' => 'percentage',

            // Units
            'weightUnit' => 'g',
            'dimensionUnit' => 'mm',

            // Packing method
            'packingMethod' => 'singleBox',

            // List of provided services
            'services' => [
                'AUS_PARCEL_EXPRESS' => 'Express Post',
                'AUS_PARCEL_REGULAR' => 'Parcel Post',
            ],
          ],
        ],
    ]
];

Please let me know if you need any more info to try and replicate or if you need me to test anything else.

Thanks heaps, Alby

engram-design commented 3 years ago

Looks like that testing functionality just needs to be tweaked, which I have done in the latest craft-3 branch, if you want to try that.

Otherwise, can you provide the storage/logs/postie.log log file?

engram-design commented 3 years ago

Actually, I believe your units need to be kg and cm for use with Australia Post. The weight/dimension units used by your store's products is completely separate, and Postie will convert them for you. The units here are strictly for what units the box-packing algorithm should use, and therefore send to the provider's API. AusPost I believe only supports kg/cm.

Some providers allow changing the units used for the boxes being packed - and in fact some like FedEx and UPS will fail if your account is setup in one region and you try to use an unsupported unit.

If you can test changing those units?

ax2000 commented 3 years ago

Thanks for the prompt reply @engram-design .

I have updated the units to kg and cm and the shipping options appear correctly now, thanks heaps for that.