LokiCheckout_LoqateDevTools
This Magento 2 module is a development add-on to LokiCheckout_Loqate. It fakes the Loqate API, so that the address search can be tested without a Loqate account or credit. Never install it in production.
Installation
composer require --dev loki-checkout/magento2-loqate-dev-tools
bin/magento module:enable LokiCheckout_LoqateDevTools
Usage
Enable Stores > Configuration > Loki Checkout > Loqate Dev Tools > Use Fake Loqate API (loki_checkout/loqate_dev_tools/fake_api). Any non-empty Loqate API key then works, Loqate is never called and responses are not cached. The fake API answers with the fixtures in Client/fixtures/:
SW1Areturns the containerSW1A 2AA(3 addresses), which expands into 10, 11 and Flat 2, 12 Downing Street.SW1A 2AAorDowning Streetreturns those three addresses directly (country United Kingdom).1600 Amphitheatrereturns 1600 Amphitheatre Pkwy, Mountain View, California (country United States).- Any other search returns no results; an unknown address id returns error
1001"Id Invalid". - The API key
invalid-api-keyreturns error2"Unknown key", the API keyout-of-credit-api-keyreturns error3"Account out of credit".
The fake API is a Guzzle handler that Plugin/FakeApiPlugin.php adds to the HTTP client of LokiCheckout\Loqate\Client\LoqateClientFactory. The responses use the same format as the Loqate Capture Interactive Find (v1.10) and Retrieve (v1.20) services.
@dev
to the composer command.
Support
For getting support, create an Issue under the following project URL:
https://gitlab.loki-extensions.com/loki-checkout-dev/LokiCheckout_LoqateDevTools.git
Composer details
LokiCheckout_LoqateDevToolsloki-checkout/magento2-loqate-dev-tools
ext-json: *
ext-pcre: *
guzzlehttp/guzzle: ^7.10
guzzlehttp/promises: ^1.4 || ^2.0
guzzlehttp/psr7: ^2.0
loki-checkout/magento2-core: ^2.7
loki-checkout/magento2-loqate: dev-main || ~0.0
magento/framework: ^103.0
magento/module-backend: ^102.0
magento/module-config: ^101.2
magento/module-store: ^101.1
php: >=8.2 <8.6
psr/http-message: ^1.0 || ^2.0