To Reproduce
Steps to reproduce the behavior:
- Go to a checkout page
- Enter a valid postcode
- Wait for validation
Expected result
A valid postcode should always return a street and city and place them in the corresponding field. The address and city fields should become visible for the end user.
Actual result
No address is being returned and an error is being displayed, telling the end user that the address is invalid and they have to manually enter an address. The street field is visible, but the city fields stays hidden.
After changing the postcode (for example from lowercase to uppercase) a second check is done, which does return a street and city. The street field is being field with the data returned from the API, but the city field stays hidden.
When going to the payment step, the city is empty as well, rendering an error for the user.
Workaround
None
Screenshots
![Screenshot_20220922-111757_Samsung Internet](https://user-images.githubusercontent.com/80255844/191718852-9db59233-28ea-42c8-abf9-4688d8698d66.jpg)
Please complete the following information
- Magento version: 2.4.3-p1
- PHP version: 7.4.28
- Extension version: 1.5.1
Additional information
In some cases the module returns a PHP error. However, these error do seem related to the problem, since they don't happen at the same moment the end user is in the checkout. I'm still including the error here, because maybe this is still related.
TypeError: Argument 5 passed to TIG\Postcode\Plugin\Checkout\Model\GuestPaymentInformationManagement::beforeSavePaymentInformation() must be an instance of Magento\Quote\Api\Data\AddressInterface, nul
l given, called in /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php on line 121 and defined in /data/web/magento2/vendor/tig/postcode-magento2/Plugin/Checkout/Model/GuestPaymentInformationManagement.php:62
Stack trace:
#0 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(121): TIG\Postcode\Plugin\Checkout\Model\GuestPaymentInformationManagement->beforeSavePaymentInformation()
#1 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->Magento\Framework\Interception\{closure}()
#2 /data/web/magento2/generated/code/Magento/Checkout/Model/GuestPaymentInformationManagement/Interceptor.php(32): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callPlugins()
#3 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->savePaymentInformation()
#4 /data/web/magento2/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array()
#5 /data/web/magento2/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process()
#6 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch()
#7 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent()
#8 /data/web/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}()
#9 /data/web/magento2/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins()
#10 /data/web/magento2/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch()
#11 /data/web/magento2/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#12 /data/web/magento2/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#13 /data/web/magento2/pub/index.php(29): Magento\Framework\App\Bootstrap->run()
#14 {main} [] []