postcode-nl / PostcodeNl_Api_Magento2

A Magento 2 plugin that implements the Postcode.nl international address API
https://developer.postcode.eu/documentation/
BSD 2-Clause "Simplified" License
10 stars 13 forks source link

prepareApiClient (Helper) - wrong return type - support for storecode in url #47

Closed RickvanB closed 2 years ago

RickvanB commented 2 years ago

Magento version: 2.4.2-p2 Module version: 3.1.1

Suggestion: Is it possible to add support for storecodes in the URL? Otherwise the error below gets thrown:

When a user fills in the postal code + housenumber, an ajax call gets fired to (/postcode-eu/V1/nl/address//). The following error gets logged: report.CRITICAL: TypeError: Return value of Flekto\Postcode\Helper\ApiClientHelper::prepareApiClient() must be an instance of Flekto\Postcode\Helper\PostcodeApiClient, array returned in /vendor/postcode-nl/api-magento2-module/Helper/ApiClientHelper.php:110

Which means that the return type of 'prepareApiClient' should be mixed or add array as return type.

JerrySmidt commented 2 years ago

The latest version seems to work with store codes enabled.