Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Lack of cast is throwing an exception and fails to retrieve list of parcel services #78

Closed
wants to merge 3 commits into from

Conversation

posttechguy
Copy link

exception 'Guzzle\Service\Exception\ValidationException' with message 'Validation errors: [from_postcode] must be of type integer
[to_postcode] must be of type integer' in vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php:357
Stack trace:
#0 vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(236): Guzzle\Service\Command\AbstractCommand->validate()
#1 vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(205): Guzzle\Service\Command\AbstractCommand->prepare()
#2 vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(136): Guzzle\Service\Client->prepareCommand(Object(Guzzle\Service\Command\OperationCommand))
#3 vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(153): Guzzle\Service\Client->execute(Object(Guzzle\Service\Command\OperationCommand))
#4 vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(189): Guzzle\Service\Command\AbstractCommand->execute()
#5 vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(76): Guzzle\Service\Command\AbstractCommand->getResult()
#6 app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php(140): Guzzle\Service\Client->__call('listDomesticPar...', Array)
#7 app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php(140): Auspost\Postage\PostageClient->listDomesticParcelServices(Array)
#8 app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php(125): Fontis_Australia_Model_Shipping_Carrier_Australiapost->_getQuotes(5000, Array)
#9 app/code/core/Mage/Shipping/Model/Shipping.php(180): Fontis_Australia_Model_Shipping_Carrier_Australiapost->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#10 app/code/core/Mage/Shipping/Model/Shipping.php(129): Mage_Shipping_Model_Shipping->collectCarrierRates('australiapost', Object(Mage_Shipping_Model_Rate_Request))
#11 app/code/local/Magebright/Shipingresriction/Model/Shipping/Shipping.php(6): Mage_Shipping_Model_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#12 app/code/core/Mage/Sales/Model/Quote/Address.php(944): Magebright_Shipingresriction_Model_Shipping_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#13 app/code/core/Mage/Sales/Model/Quote/Address.php(875): Mage_Sales_Model_Quote_Address->requestShippingRates()
#14 app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php(155): Mage_Sales_Model_Quote_Address->collectShippingRates()
#15 app/code/core/Mage/Sales/Model/Quote/Address.php(1013): Mage_Sales_Model_Quote_Address_Total_Shipping->collect(Object(Mage_Sales_Model_Quote_Address))
#16 app/code/core/Mage/Sales/Model/Quote.php(1331): Mage_Sales_Model_Quote_Address->collectTotals()
#17 app/code/core/Mage/Checkout/Model/Cart.php(458): Mage_Sales_Model_Quote->collectTotals()
#18 app/code/core/Mage/Checkout/controllers/CartController.php(144): Mage_Checkout_Model_Cart->save()
#19 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->indexAction()
#20 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#21 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#22 app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#23 app/Mage.php(692): Mage_Core_Model_App->run(Array)
#24 index.php(83): Mage::run('', 'store')
#25 {main}```

@chnorton
Copy link
Member

chnorton commented Sep 4, 2018

@posttechguy What version of auspost-api-php library do you have installed? This was updated to 1.0.5 a while back to allow either integer or string versions of the postcodes. Casting to an integer was previously causing issues with postcodes that start with 0, which is why we also allow strings.

@posttechguy
Copy link
Author

posttechguy commented Sep 10, 2018 via email

@posttechguy
Copy link
Author

@cnorton this issue #77 looks similar to mine

@chnorton
Copy link
Member

@posttechguy I still believe the issue is just related to an older version of the auspost-api-php library. Could you try upgrading that library first?

composer update fontis/auspost-api-php

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants