diff --git a/.gitignore b/.gitignore index 2f8f535..3561c12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -# .gitignore for M2-Postcode.nl module by Flekto .DS_Store vendor composer.lock diff --git a/Api/Data/Autocomplete.php b/Api/Data/Autocomplete.php index 41f4049..1bf1b18 100644 --- a/Api/Data/Autocomplete.php +++ b/Api/Data/Autocomplete.php @@ -1,6 +1,6 @@ _updateNotifier->notifyVersion($moduleInfo['latest_version']) ) { - $this->_logger->info(__('Added notification for Postcode.eu Address API %1 update.', $moduleInfo['latest_version'])); + $this->_logger->info(__('Added notification for Postcode.eu Address Validation %1 update.', $moduleInfo['latest_version'])); } } } diff --git a/Cron/UpdateApiData.php b/Cron/UpdateApiData.php index 1e4f436..5d3adba 100644 --- a/Cron/UpdateApiData.php +++ b/Cron/UpdateApiData.php @@ -1,9 +1,9 @@ getId(), [ 'data' => [ - 'template' => 'Flekto_Postcode::form/element/address-autofill.phtml', + 'template' => 'PostcodeEu_AddressValidation::form/element/address-autofill.phtml', 'jsLayout' => $this->getJsLayout(), ], ], @@ -66,7 +66,7 @@ public function getJsLayout(): array return [ 'components' => [ $this->getId() => [ - 'component' => 'Flekto_Postcode/js/view/address/autofill', + 'component' => 'PostcodeEu_AddressValidation/js/view/address/autofill', 'config' => [ 'settings' => $this->getData('settings'), 'htmlIdPrefix' => $this->getData('htmlIdPrefix'), @@ -76,7 +76,7 @@ public function getJsLayout(): array ], 'children' => [ 'address_autofill_nl' => [ - 'component' => 'Flekto_Postcode/js/view/form/sales/order_create/address-autofill-nl', + 'component' => 'PostcodeEu_AddressValidation/js/view/form/sales/order_create/address-autofill-nl', 'config' => [ 'componentDisabled' => $this->getData('isNlComponentDisabled'), ], @@ -86,7 +86,7 @@ public function getJsLayout(): array 'label' => __('Zip/Postal Code'), 'config' => [ 'template' => 'ui/form/field', - 'elementTmpl' => 'Flekto_Postcode/form/element/address-autofill-field', + 'elementTmpl' => 'PostcodeEu_AddressValidation/form/element/address-autofill-field', 'placeholder' => '1234 AB', 'imports' => [ 'visible' => '${ $.parentName }:visible', @@ -101,7 +101,7 @@ public function getJsLayout(): array ], 'config' => [ 'template' => 'ui/form/field', - 'elementTmpl' => 'Flekto_Postcode/form/element/address-autofill-field', + 'elementTmpl' => 'PostcodeEu_AddressValidation/form/element/address-autofill-field', 'imports' => [ 'visible' => '${ $.parentName }:visible', ], @@ -119,7 +119,7 @@ public function getJsLayout(): array ], ], 'address_autofill_intl' => [ - 'component' => 'Flekto_Postcode/js/view/form/sales/order_create/address-autofill-intl', + 'component' => 'PostcodeEu_AddressValidation/js/view/form/sales/order_create/address-autofill-intl', 'label' => __('Find an address'), 'placeholder' => __('City, street or postcode') ], diff --git a/GraphQl/Exception/GraphQlHeaderException.php b/GraphQl/Exception/GraphQlHeaderException.php index 19ce080..6344e12 100644 --- a/GraphQl/Exception/GraphQlHeaderException.php +++ b/GraphQl/Exception/GraphQlHeaderException.php @@ -1,6 +1,6 @@ _logger->error($exception->getMessage(), ['exception' => $exception]); } @@ -422,7 +422,7 @@ public function getSupportedCountries(): array * Validate a full address, correcting and completing all parts of the address. * * @access public - * @see \Flekto\Postcode\Service\PostcodeApiClient::validateAddress() + * @see \PostcodeEu\AddressValidation\Service\PostcodeApiClient::validateAddress() * @return array */ public function validateAddress(): array diff --git a/Helper/Data.php b/Helper/Data.php index 3d68942..a3f9503 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -1,17 +1,17 @@ _dir->getPath('var') . '/Flekto_Postcode'; + $path = $this->_dir->getPath(DirectoryList::VAR_DIR) . '/PostcodeEu_AddressValidation'; if (!$this->_fs->isDirectory($path)) { $this->_fs->createDirectory($path, 0755); } diff --git a/Helper/StoreConfigHelper.php b/Helper/StoreConfigHelper.php index 1de1066..34c9d3e 100644 --- a/Helper/StoreConfigHelper.php +++ b/Helper/StoreConfigHelper.php @@ -1,6 +1,6 @@ _httpRequest->getHeader($headerName); if (empty($headerValue)) { throw new GraphQlHeaderException(__('%1 header not found.', $headerName)); diff --git a/Model/Resolver/IntlAddress/Details.php b/Model/Resolver/IntlAddress/Details.php index d45f124..b9724eb 100644 --- a/Model/Resolver/IntlAddress/Details.php +++ b/Model/Resolver/IntlAddress/Details.php @@ -1,8 +1,8 @@ _storeConfigHelper->getValue('account_status') != \Flekto\Postcode\Helper\ApiClientHelper::API_ACCOUNT_STATUS_ACTIVE; + return $this->_storeConfigHelper->getValue('account_status') != \PostcodeEu\AddressValidation\Helper\ApiClientHelper::API_ACCOUNT_STATUS_ACTIVE; } /** diff --git a/Model/System/Message/RebrandNotice.php b/Model/System/Message/RebrandNotice.php new file mode 100644 index 0000000..daba2a5 --- /dev/null +++ b/Model/System/Message/RebrandNotice.php @@ -0,0 +1,64 @@ +moduleList = $moduleList; + } + + /** + * @return string + */ + public function getIdentity(): string + { + return self::MESSAGE_IDENTITY; + } + + /** + * @return bool + */ + public function isDisplayed(): bool + { + foreach ($this->moduleList->getAll() as $module) + { + if (isset($module['sequence']) && in_array('Flekto_Postcode', $module['sequence'])) + { + return true; + } + } + + return false; + } + + /** + * @return string + */ + public function getText(): string + { + return (string)__( + 'Compatibility notice: The Postcode.eu Address Validation module has been rebranded. ' . + 'The PHP namespace has changed from Flekto\Postcode to PostcodeEu\AddressValidation. ' . + 'Since your installation contains custom code or integrations relying on the old namespace, ' . + 'please update your references to ensure continued compatibility. ' + ); + } + + /** + * @return int + */ + public function getSeverity(): int + { + return self::SEVERITY_MINOR; + } +} diff --git a/Model/UpdateNotification.php b/Model/UpdateNotification.php index b2d8ce4..4d1c5ff 100644 --- a/Model/UpdateNotification.php +++ b/Model/UpdateNotification.php @@ -1,8 +1,8 @@ _notifier->addNotice( - __('Postcode.eu Address API update available'), + __('Postcode.eu Address Validation update available'), __('Stay ahead with our latest update. Get the newest features and improvements for our Postcode.eu address validation module.'), - \Flekto\Postcode\Helper\Data::MODULE_RELEASE_URL + \PostcodeEu\AddressValidation\Helper\Data::MODULE_RELEASE_URL ); $this->_updateNotification->setVersionNotified($version); return $this->_updateNotification->isVersionNotified($version); diff --git a/Model/UpdateNotificationRepository.php b/Model/UpdateNotificationRepository.php index e7b5174..8ad3f2f 100644 --- a/Model/UpdateNotificationRepository.php +++ b/Model/UpdateNotificationRepository.php @@ -1,11 +1,11 @@ _configWriter->save(StoreConfigHelper::PATH['account_status'], ApiClientHelper::API_ACCOUNT_STATUS_INACTIVE); } - } catch (\Flekto\Postcode\Service\Exception\AuthenticationException $e) { + } catch (\PostcodeEu\AddressValidation\Service\Exception\AuthenticationException $e) { $this->_configWriter->save(StoreConfigHelper::PATH['account_status'], ApiClientHelper::API_ACCOUNT_STATUS_INVALID_CREDENTIALS); $this->_configWriter->delete(StoreConfigHelper::PATH['account_name']); - } catch (\Flekto\Postcode\Service\Exception\ClientException $e) { + } catch (\PostcodeEu\AddressValidation\Service\Exception\ClientException $e) { $this->_configWriter->delete(StoreConfigHelper::PATH['account_name']); $this->_configWriter->delete(StoreConfigHelper::PATH['account_status']); @@ -140,6 +140,6 @@ private function _purgeCachedData(): void { $this->_cleanConfigCache(); $cache = $this->_cacheFrontendPool->get(\Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER); - $cache->remove(\Flekto\Postcode\Block\System\Config\Status::CACHE_ID); + $cache->remove(\PostcodeEu\AddressValidation\Block\System\Config\Status::CACHE_ID); } } diff --git a/Plugin/AddAddressAutofillToOrderCreateForm.php b/Plugin/AddAddressAutofillToOrderCreateForm.php index b2b8e25..1b8bebc 100644 --- a/Plugin/AddAddressAutofillToOrderCreateForm.php +++ b/Plugin/AddAddressAutofillToOrderCreateForm.php @@ -1,10 +1,10 @@ addType( 'postcode-eu-address-autofill', - \Flekto\Postcode\Data\Form\Element\AddressAutofill::class, + \PostcodeEu\AddressValidation\Data\Form\Element\AddressAutofill::class, ); $addressType = $subject->getIsShipping() ? 'shipping' : 'billing'; $fieldId = $addressType . '_address_autofill'; diff --git a/Plugin/SortSalesOrderAddressFields.php b/Plugin/SortSalesOrderAddressFields.php index 50b6dc5..65f7f04 100644 --- a/Plugin/SortSalesOrderAddressFields.php +++ b/Plugin/SortSalesOrderAddressFields.php @@ -1,10 +1,10 @@ getAlias() === 'city_validator' ) { - return [new \Flekto\Postcode\Model\Validator\City(), $breakChainOnFailure]; + return [new \PostcodeEu\AddressValidation\Model\Validator\City(), $breakChainOnFailure]; } // Return null if not changing arguments, see diff --git a/README.md b/README.md index 4cb5730..9988059 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ ## International Address API module for Magento 2 -Adds autocompletion for addresses to the checkout page. [Multiple countries](https://www.postcode.nl/services/adresdata/internationaal) are supported using official postal data via the [Postcode.eu](https://postcode.eu) API. +Adds autocompletion for addresses to the checkout page. [Multiple countries](https://www.postcode.eu/products/address-api/international) are supported using official postal data via the [Postcode.eu](https://postcode.eu) API. -This module is maintained by [Postcode.nl](https://postcode.nl) since version 3.0.0. Earlier versions were developed by [Flekto](https://www.flekto.nl). +This module is maintained by [Postcode.eu](https://postcode.eu). ## Postcode.eu account -A [Postcode.eu account](https://www.postcode.nl/en/services/adresdata/producten-overzicht) is required. +A [Postcode.eu account](https://account.postcode.eu) is required. Testing is free. After testing you can choose to purchase a subscription. ## Installation instructions @@ -61,7 +61,7 @@ Our module now supports GraphQL, allowing you to query address data via Magento' ## Compatibility -Although we can't guarantee compatibility with other checkout modules, our module works well with most one-step-checkout modules. If you are having issues and think this may be caused by our module, please [contact Postcode.nl](mailto:tech@postcode.nl) and tell us which other module(s) and version(s) are used. +Although we can't guarantee compatibility with other checkout modules, our module works well with most one-step-checkout modules. If you are having issues and think this may be caused by our module, please [contact Postcode.eu](mailto:tech@postcode.nl) and tell us which other module(s) and version(s) are used. If you found the solution already and have some code to contribute, feel free to open a pull request in this repository. @@ -76,7 +76,7 @@ Instructions for additional configuration and customization can be found on the ## FAQ and Knowledge Base * View Frequently Asked Questions at https://www.postcode.eu/#faq. -* For more questions and answers, see https://kb.postcode.nl/help +* For more questions and answers, see https://kb.postcode.eu * If the above didn't answer your question, [contact us](https://www.postcode.eu/contact). ## License diff --git a/Service/Exception/AuthenticationException.php b/Service/Exception/AuthenticationException.php index a1b52f2..1a6375a 100644 --- a/Service/Exception/AuthenticationException.php +++ b/Service/Exception/AuthenticationException.php @@ -1,6 +1,6 @@ _userAgent === null) { $this->_userAgent = sprintf( '%s/%s %s/%s/%s PHP/%s', - \Flekto\Postcode\Helper\Data::VENDOR_PACKAGE, + \PostcodeEu\AddressValidation\Helper\Data::VENDOR_PACKAGE, $this->_storeConfigHelper->getModuleVersion(), $this->_productMetadata->getName(), $this->_productMetadata->getEdition(), diff --git a/Setup/Patch/Data/EncryptApiSecrets.php b/Setup/Patch/Data/EncryptApiSecrets.php index 2dc7f1a..6441eef 100644 --- a/Setup/Patch/Data/EncryptApiSecrets.php +++ b/Setup/Patch/Data/EncryptApiSecrets.php @@ -1,6 +1,6 @@ _resourceConfig->getConnection()->startSetup(); $connection = $this->_resourceConfig->getConnection(); - $path = \Flekto\Postcode\Helper\StoreConfigHelper::PATH['api_secret']; + $path = \PostcodeEu\AddressValidation\Helper\StoreConfigHelper::PATH['api_secret']; $select = $connection->select() ->from($this->_resourceConfig->getTable('core_config_data')) ->where('path = ?', $path); @@ -48,6 +48,11 @@ public function apply(): void continue; } + // Skip if already encrypted (Magento encrypted values start with '0:') + if (str_starts_with($row['value'], '0:')) { + continue; + } + $encryptedSecret = $this->_encryptor->encrypt($row['value']); $this->_resourceConfig->saveConfig($path, $encryptedSecret, $row['scope'], $row['scope_id']); } @@ -62,7 +67,7 @@ public function apply(): void */ public function getAliases(): array { - return []; + return ['Flekto\Postcode\Setup\Patch\Data\EncryptApiSecrets']; } /** diff --git a/Setup/Patch/Data/UpdateApiStatusConfig.php b/Setup/Patch/Data/UpdateApiStatusConfig.php index 1d6b17b..c098e36 100644 --- a/Setup/Patch/Data/UpdateApiStatusConfig.php +++ b/Setup/Patch/Data/UpdateApiStatusConfig.php @@ -1,9 +1,9 @@ $scopeIdValues) { foreach ($scopeIdValues as $scopeId => $credentials) { - if (empty($credentials[StoreConfigHelper::PATH['api_key']]) || empty($credentials[StoreConfigHelper::PATH['api_secret']])) { continue; } + // Skip if already migrated + $existingStatus = $connection->fetchOne( + $connection->select() + ->from($this->_resourceConfig->getTable('core_config_data'), ['value']) + ->where('path = ?', StoreConfigHelper::PATH['account_status']) + ->where('scope = ?', $scope) + ->where('scope_id = ?', $scopeId) + ); + + if ($existingStatus !== false) { + continue; + } + try { $client = $this->_apiClientHelper->getApiClient(); @@ -104,7 +116,7 @@ public function apply(): void $this->_resourceConfig->saveConfig(StoreConfigHelper::PATH['account_status'], ApiClientHelper::API_ACCOUNT_STATUS_INACTIVE, $scope, $scopeId); } - } catch (\Flekto\Postcode\Service\Exception\AuthenticationException $e) { + } catch (\PostcodeEu\AddressValidation\Service\Exception\AuthenticationException $e) { $this->_resourceConfig->saveConfig(StoreConfigHelper::PATH['account_status'], ApiClientHelper::API_ACCOUNT_STATUS_INVALID_CREDENTIALS, $scope, $scopeId); } diff --git a/composer.json b/composer.json index b9c0af6..02494f4 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "postcode-nl/api-magento2-module", - "version": "3.7.1", - "description": "Postcode.eu International Address API module for Magento 2. Adds autocompletion for addresses in multiple countries using official postal data.", + "version": "4.0.0", + "description": "Postcode.eu Address Validation module for Magento 2. Adds autocompletion for addresses in multiple countries using official postal data.", "require": { "php": "^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4 || ^8.5", "magento/module-checkout": "~100.4" @@ -12,8 +12,7 @@ "autoload": { "files": [ "registration.php" ], "psr-4": { - "Flekto\\Postcode\\": "", - "PostcodeNl\\InternationalAutocomplete\\": "app/code/Flekto/Postcode/lib/InternationalAutocomplete/" + "PostcodeEu\\AddressValidation\\": "" } } } diff --git a/etc/acl.xml b/etc/acl.xml index e92215c..28b6696 100644 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -6,7 +6,7 @@ - + diff --git a/etc/adminhtml/di.xml b/etc/adminhtml/di.xml index 8921a90..b11fe65 100644 --- a/etc/adminhtml/di.xml +++ b/etc/adminhtml/di.xml @@ -3,16 +3,17 @@ - Flekto\Postcode\Model\System\Message\LicenceCheck + PostcodeEu\AddressValidation\Model\System\Message\LicenceCheck + PostcodeEu\AddressValidation\Model\System\Message\RebrandNotice - + - + diff --git a/etc/adminhtml/events.xml b/etc/adminhtml/events.xml index 82f029b..53e8691 100644 --- a/etc/adminhtml/events.xml +++ b/etc/adminhtml/events.xml @@ -1,7 +1,7 @@ - + diff --git a/etc/adminhtml/routes.xml b/etc/adminhtml/routes.xml index 269e3cb..f9059bb 100644 --- a/etc/adminhtml/routes.xml +++ b/etc/adminhtml/routes.xml @@ -1,7 +1,7 @@ - - + + \ No newline at end of file diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index de518b9..79236c1 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -2,13 +2,13 @@
- + sales postcode-eu-api-section - Flekto_Postcode::config_flekto_postcode + PostcodeEu_AddressValidation::config_postcode_eu - Flekto\Postcode\Block\System\Config\Status + PostcodeEu\AddressValidation\Block\System\Config\Status @@ -32,12 +32,12 @@ - Flekto\Postcode\Model\Config\Source\NlInputBehavior + PostcodeEu\AddressValidation\Model\Config\Source\NlInputBehavior - Flekto\Postcode\Model\Config\Source\ShowHideAddressFields + PostcodeEu\AddressValidation\Model\Config\Source\ShowHideAddressFields @@ -60,7 +60,7 @@ Selected countries will have Address API disabled. - Flekto\Postcode\Model\Config\Source\DisabledCountries + PostcodeEu\AddressValidation\Model\Config\Source\DisabledCountries @@ -70,7 +70,7 @@ Control address autocomplete behavior for the admin order form. - Flekto\Postcode\Model\Config\Source\AdminAddressAutocompleteBehavior + PostcodeEu\AddressValidation\Model\Config\Source\AdminAddressAutocompleteBehavior diff --git a/etc/config.xml b/etc/config.xml index 10721ec..8cb62c5 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -3,7 +3,7 @@ - 3.7.1 + 4.0.0 new diff --git a/etc/crontab.xml b/etc/crontab.xml index 9144a4a..a72a577 100644 --- a/etc/crontab.xml +++ b/etc/crontab.xml @@ -1,10 +1,10 @@ - + 3 3 * * * - + 3 3 * * * diff --git a/etc/di.xml b/etc/di.xml index ce9546e..04f3316 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -1,13 +1,13 @@ - - - + + + - + - + diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index d506e1d..96caa2e 100644 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -3,7 +3,7 @@ - Flekto\Postcode\Block\Onepage\LayoutProcessor + PostcodeEu\AddressValidation\Block\Onepage\LayoutProcessor diff --git a/etc/module.xml b/etc/module.xml index 6450aef..62825ab 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - + diff --git a/etc/schema.graphqls b/etc/schema.graphqls index 76752dc..8a349da 100644 --- a/etc/schema.graphqls +++ b/etc/schema.graphqls @@ -2,15 +2,15 @@ type Query { dutchAddress( postcode: String! @doc(description: "Dutch postcode in the \"1234AB\" format.") houseNumber: String! @doc(description: "House number. May include an addition.") - ): DutchAddressResult! @resolver(class: "Flekto\\Postcode\\Model\\Resolver\\DutchAddress") @doc(description: "Get an address based on its unique combination of postcode, house number and house number addition.") + ): DutchAddressResult! @resolver(class: "PostcodeEu\\AddressValidation\\Model\\Resolver\\DutchAddress") @doc(description: "Get an address based on its unique combination of postcode, house number and house number addition.") intlAddressMatches( context: String! = "NL" @doc(description: "Initial autocomplete context. E.g. a country code to start searching in that country. The country code is not case sensitive and can be two or three characters. In subsequent requests, the context should be set to the context of the selected match.") term: String! @doc(description: "The address search term. May be a complete or partial address. When a user selects a match, use the exact and unmodified \"value\" field of the selected match for the term parameter. In subsequent requests, the term should be set to the value of the selected match.") - ): IntlAddressMatches! @resolver(class: "Flekto\\Postcode\\Model\\Resolver\\IntlAddress\\Matches") @doc(description: "Get a list of autocomplete matches based on a single (partial) address term. Depending on the input different types of matches may be returned, such as streets, postal codes or a specific address. Required session header: Both the autocomplete and getDetails methods require a custom HTTP header named X-Autocomplete-Session to be specified. Its value should identify a single address completion session (for example, a user filling out one checkout address) and remain the same for calls to both methods. The session header should be at least 8 characters and at most 64 characters long. The value must only contain alphanumeric characters (case insensitive), \"-\", \"_\" and/or \".\". Reusing the same session identifier for completing more than one address is not recommended as it may lead to increased costs for your account.") + ): IntlAddressMatches! @resolver(class: "PostcodeEu\\AddressValidation\\Model\\Resolver\\IntlAddress\\Matches") @doc(description: "Get a list of autocomplete matches based on a single (partial) address term. Depending on the input different types of matches may be returned, such as streets, postal codes or a specific address. Required session header: Both the autocomplete and getDetails methods require a custom HTTP header named X-Autocomplete-Session to be specified. Its value should identify a single address completion session (for example, a user filling out one checkout address) and remain the same for calls to both methods. The session header should be at least 8 characters and at most 64 characters long. The value must only contain alphanumeric characters (case insensitive), \"-\", \"_\" and/or \".\". Reusing the same session identifier for completing more than one address is not recommended as it may lead to increased costs for your account.") intlAddressDetails( context: String! @doc(description: "Context with precision address to get detailed address information.") - ): IntlAddressDetails! @resolver(class: "Flekto\\Postcode\\Model\\Resolver\\IntlAddress\\Details") @doc(description: "Get address information based on the provided autocomplete context. The context must have the precision `address`. A HTTP status 400 response is given when the provided context does not resolve to a single address. This method is intended to provide address information using the result context from the autocomplete method. The result of this method can be used to complete an address in an order form for example. A session header is required, see IntlAddressMatches for details.") - addressApiSettings: AddressApiSettings! @doc(description: "Settings for the Postcode.eu Address API.") @resolver(class: "Flekto\\Postcode\\Model\\Resolver\\AddressApiSettings") + ): IntlAddressDetails! @resolver(class: "PostcodeEu\\AddressValidation\\Model\\Resolver\\IntlAddress\\Details") @doc(description: "Get address information based on the provided autocomplete context. The context must have the precision `address`. A HTTP status 400 response is given when the provided context does not resolve to a single address. This method is intended to provide address information using the result context from the autocomplete method. The result of this method can be used to complete an address in an order form for example. A session header is required, see IntlAddressMatches for details.") + addressApiSettings: AddressApiSettings! @doc(description: "Settings for the Postcode.eu Address API.") @resolver(class: "PostcodeEu\\AddressValidation\\Model\\Resolver\\AddressApiSettings") validateAddress( country: String! @doc(description: "ISO country code.") postcode: String @doc(description: "The postcode.") @@ -19,7 +19,7 @@ type Query { building: String @doc(description: "The full building number, including any additions.") region: String @doc(description: "The region name. Depending on the country this can be a province, a state or another type of administrative region. This is not typically needed to find matches, but can sometimes be useful to distinguish between otherwise similar matches.") streetAndBuilding: String @doc(description: "The street name and building number. Use this parameter if you do not have separate street and building data. This parameter is not allowed in combination with the street or building parameter.") - ): ValidatedAddressResult @resolver(class: "Flekto\\Postcode\\Model\\Resolver\\ValidatedAddress") + ): ValidatedAddressResult @resolver(class: "PostcodeEu\\AddressValidation\\Model\\Resolver\\ValidatedAddress") } type DutchAddressResult { diff --git a/etc/webapi.xml b/etc/webapi.xml index 4a9ec68..b649abc 100644 --- a/etc/webapi.xml +++ b/etc/webapi.xml @@ -1,35 +1,35 @@ - + - + - + - + - + diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 5325443..20a4cd6 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -10,9 +10,9 @@ "Key or secret are invalid","Key or secret are invalid" "Your account is active with name: ","Your account is active with name: " "Key is valid but has no access","Key is valid but has no access" -"Flekto Postcode.eu update countries start","Flekto Postcode.eu update countries start" -"Flekto Postcode.eu update countries FAILED: ","Flekto Postcode.eu update countries FAILED: " -"Flekto Postcode.eu update countries executed: ","Flekto Postcode.eu update countries executed: " +"Postcode.eu update countries start","Postcode.eu update countries start" +"Postcode.eu update countries FAILED: ","Postcode.eu update countries FAILED: " +"Postcode.eu update countries executed: ","Postcode.eu update countries executed: " "Postcode.eu API Autocomplete","Postcode.eu API Autocomplete" "Configuration","Configuration" "Enabled","Enabled" @@ -75,6 +75,7 @@ "Supported countries","Supported countries" "euro","euro" "Address API","Address API" +"Address Validation","Adres Validation" "Usage at %1%","Usage at %1%" "new","new" "active","active" diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv index 04577cd..7ac8956 100644 --- a/i18n/nl_BE.csv +++ b/i18n/nl_BE.csv @@ -10,9 +10,9 @@ "Key or secret are invalid","Key of secret zijn ongeldig" "Your account is active with name: ","Uw account is actief met de naam: " "Key is valid but has no access","Key is geldig maar heeft geen toegang" -"Flekto Postcode.eu update countries start","Flekto Postcode.eu update landen starten" -"Flekto Postcode.eu update countries FAILED: ","Flekto Postcode.eu update landen MISLUKT: " -"Flekto Postcode.eu update countries executed: ","Flekto Postcode.eu update landen uitgevoerd: " +"Postcode.eu update countries start","Postcode.eu update landen starten" +"Postcode.eu update countries FAILED: ","Postcode.eu update landen MISLUKT: " +"Postcode.eu update countries executed: ","Postcode.eu update landen uitgevoerd: " "Postcode.eu API Autocomplete","Postcode.eu API Autocomplete" "Configuration","Configuratie" "Enabled","Ingeschakeld" @@ -75,6 +75,7 @@ "Supported countries","Ondersteunde landen" "euro","euro" "Address API","Adres API" +"Address Validation","Adres Validatie" "Usage at %1%","Verbruik op %1%" "new","nieuw" "active","actief" diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index 04577cd..7ac8956 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -10,9 +10,9 @@ "Key or secret are invalid","Key of secret zijn ongeldig" "Your account is active with name: ","Uw account is actief met de naam: " "Key is valid but has no access","Key is geldig maar heeft geen toegang" -"Flekto Postcode.eu update countries start","Flekto Postcode.eu update landen starten" -"Flekto Postcode.eu update countries FAILED: ","Flekto Postcode.eu update landen MISLUKT: " -"Flekto Postcode.eu update countries executed: ","Flekto Postcode.eu update landen uitgevoerd: " +"Postcode.eu update countries start","Postcode.eu update landen starten" +"Postcode.eu update countries FAILED: ","Postcode.eu update landen MISLUKT: " +"Postcode.eu update countries executed: ","Postcode.eu update landen uitgevoerd: " "Postcode.eu API Autocomplete","Postcode.eu API Autocomplete" "Configuration","Configuratie" "Enabled","Ingeschakeld" @@ -75,6 +75,7 @@ "Supported countries","Ondersteunde landen" "euro","euro" "Address API","Adres API" +"Address Validation","Adres Validatie" "Usage at %1%","Verbruik op %1%" "new","nieuw" "active","actief" diff --git a/registration.php b/registration.php index a559de1..ea7e4e2 100644 --- a/registration.php +++ b/registration.php @@ -2,6 +2,6 @@ \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, - 'Flekto_Postcode', + 'PostcodeEu_AddressValidation', __DIR__ ); diff --git a/view/adminhtml/layout/adminhtml_system_config_edit.xml b/view/adminhtml/layout/adminhtml_system_config_edit.xml index 6beff92..6246d43 100644 --- a/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -1,6 +1,6 @@ - + diff --git a/view/adminhtml/layout/sales_order_create_index.xml b/view/adminhtml/layout/sales_order_create_index.xml index 348438f..7b88a4f 100644 --- a/view/adminhtml/layout/sales_order_create_index.xml +++ b/view/adminhtml/layout/sales_order_create_index.xml @@ -2,6 +2,6 @@ - + diff --git a/view/adminhtml/templates/system/config/status.phtml b/view/adminhtml/templates/system/config/status.phtml index 12889da..c40d29a 100644 --- a/view/adminhtml/templates/system/config/status.phtml +++ b/view/adminhtml/templates/system/config/status.phtml @@ -1,7 +1,7 @@ getConfig(); @@ -10,7 +10,7 @@ $moduleInfo = $block->getModuleInfo(); ?>
-

escapeHtml(__('Address API')) ?>

+

escapeHtml(__('Address Validation')) ?>

diff --git a/view/adminhtml/web/js/view/form/sales/order_create/address-autofill-intl.js b/view/adminhtml/web/js/view/form/sales/order_create/address-autofill-intl.js index 46c68e2..647cfe2 100644 --- a/view/adminhtml/web/js/view/form/sales/order_create/address-autofill-intl.js +++ b/view/adminhtml/web/js/view/form/sales/order_create/address-autofill-intl.js @@ -1,5 +1,5 @@ define([ - 'Flekto_Postcode/js/form/element/address-autofill-intl', + 'PostcodeEu_AddressValidation/js/form/element/address-autofill-intl', 'mage/translate', ], function (AddressAutofillIntl, $t) { 'use strict'; diff --git a/view/adminhtml/web/js/view/form/sales/order_create/address-autofill-nl.js b/view/adminhtml/web/js/view/form/sales/order_create/address-autofill-nl.js index 4259ea7..f57e02f 100644 --- a/view/adminhtml/web/js/view/form/sales/order_create/address-autofill-nl.js +++ b/view/adminhtml/web/js/view/form/sales/order_create/address-autofill-nl.js @@ -1,6 +1,6 @@ define([ - 'Flekto_Postcode/js/form/components/address-autofill-nl', - 'Flekto_Postcode/js/model/address-nl', + 'PostcodeEu_AddressValidation/js/form/components/address-autofill-nl', + 'PostcodeEu_AddressValidation/js/model/address-nl', 'mage/translate', ], function (Collection, AddressNlModel, $t) { 'use strict'; diff --git a/view/base/web/js/form/components/address-autofill-nl.js b/view/base/web/js/form/components/address-autofill-nl.js index 3790d41..a80f1aa 100644 --- a/view/base/web/js/form/components/address-autofill-nl.js +++ b/view/base/web/js/form/components/address-autofill-nl.js @@ -1,7 +1,7 @@ define([ 'uiCollection', 'jquery', - 'Flekto_Postcode/js/model/address-nl', + 'PostcodeEu_AddressValidation/js/model/address-nl', ], function (Collection, $, AddressNlModel) { 'use strict'; diff --git a/view/base/web/js/form/element/address-autofill-intl.js b/view/base/web/js/form/element/address-autofill-intl.js index d3b3421..dd0002d 100644 --- a/view/base/web/js/form/element/address-autofill-intl.js +++ b/view/base/web/js/form/element/address-autofill-intl.js @@ -2,7 +2,7 @@ define([ 'Magento_Ui/js/form/element/abstract', 'mage/translate', 'uiRegistry', - 'Flekto_Postcode/js/ko/bindings/init-intl-autocomplete', + 'PostcodeEu_AddressValidation/js/ko/bindings/init-intl-autocomplete', ], function (Abstract, $t, Registry) { 'use strict'; @@ -13,7 +13,7 @@ define([ intlAutocompleteInstance: null, settings: {}, template: 'ui/form/field', - elementTmpl: 'Flekto_Postcode/form/element/address-autofill-intl', + elementTmpl: 'PostcodeEu_AddressValidation/form/element/address-autofill-intl', visible: false, additionalClasses: { 'address-autofill-intl-input': true, diff --git a/view/base/web/js/ko/bindings/init-intl-autocomplete.js b/view/base/web/js/ko/bindings/init-intl-autocomplete.js index c4a5477..987e132 100644 --- a/view/base/web/js/ko/bindings/init-intl-autocomplete.js +++ b/view/base/web/js/ko/bindings/init-intl-autocomplete.js @@ -1,7 +1,7 @@ define([ 'ko', 'Magento_Ui/js/lib/knockout/template/renderer', - 'Flekto_Postcode/js/lib/postcode-eu-autocomplete-address', + 'PostcodeEu_AddressValidation/js/lib/postcode-eu-autocomplete-address', 'mage/translate', ], function (ko, renderer, AutocompleteAddress, $t) { 'use strict'; diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index 8d58445..1d7ddd7 100644 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -2,7 +2,7 @@ - + @@ -20,19 +20,19 @@ - Flekto_Postcode/js/form/components/checkout/address-autofill-nl + PostcodeEu_AddressValidation/js/form/components/checkout/address-autofill-nl checkoutProvider shippingAddress.address_autofill_nl checkoutProvider - + 65 - Flekto_Postcode/js/form/element/postcode + PostcodeEu_AddressValidation/js/form/element/postcode Zip/Postal Code shippingAddress @@ -41,7 +41,7 @@ postcode - Flekto_Postcode/js/form/element/house-number + PostcodeEu_AddressValidation/js/form/element/house-number House number and addition shippingAddress @@ -50,7 +50,7 @@ house_number - Flekto_Postcode/js/form/element/house-number-select + PostcodeEu_AddressValidation/js/form/element/house-number-select Which house number do you mean? - Select house number - @@ -62,9 +62,9 @@ - Flekto_Postcode/js/form/element/checkout/address-autofill-intl + PostcodeEu_AddressValidation/js/form/element/checkout/address-autofill-intl - + shippingAddress checkoutProvider @@ -76,17 +76,17 @@ shippingAddress.address_autofill_intl - Flekto_Postcode/js/form/components/checkout/address-autofill-formatted-output + PostcodeEu_AddressValidation/js/form/components/checkout/address-autofill-formatted-output - + 67 shippingAddress.address_autofill_formatted_output - Flekto_Postcode/js/form/components/checkout/address-autofill-bypass + PostcodeEu_AddressValidation/js/form/components/checkout/address-autofill-bypass - + 68 shippingAddress.address_autofill_bypass diff --git a/view/frontend/layout/customer_address_autofill.xml b/view/frontend/layout/customer_address_autofill.xml index 8eccf61..38dcb14 100644 --- a/view/frontend/layout/customer_address_autofill.xml +++ b/view/frontend/layout/customer_address_autofill.xml @@ -2,40 +2,40 @@ - + + class="PostcodeEu\AddressValidation\Block\Customer\Address\Autofill" + template="PostcodeEu_AddressValidation::customer/address/autofill.phtml"> - Flekto_Postcode/js/view/customer/address/autofill + PostcodeEu_AddressValidation/js/view/customer/address/autofill - + - Flekto_Postcode/js/form/components/customer/address/address-autofill-nl + PostcodeEu_AddressValidation/js/form/components/customer/address/address-autofill-nl - + 65 - Flekto_Postcode/js/form/element/postcode + PostcodeEu_AddressValidation/js/form/element/postcode Zip/Postal Code - Flekto_Postcode/js/form/element/house-number + PostcodeEu_AddressValidation/js/form/element/house-number House number and addition - Flekto_Postcode/js/form/element/house-number-select + PostcodeEu_AddressValidation/js/form/element/house-number-select Which house number do you mean? - Select house number - @@ -45,24 +45,24 @@ - Flekto_Postcode/js/form/element/customer/address/address-autofill-intl + PostcodeEu_AddressValidation/js/form/element/customer/address/address-autofill-intl - + Start typing your address or zip/postal code - Flekto_Postcode/js/form/components/customer/address/address-autofill-formatted-output + PostcodeEu_AddressValidation/js/form/components/customer/address/address-autofill-formatted-output - + - Flekto_Postcode/js/form/components/customer/address/address-autofill-bypass + PostcodeEu_AddressValidation/js/form/components/customer/address/address-autofill-bypass - + diff --git a/view/frontend/requirejs-config.js b/view/frontend/requirejs-config.js index 17d53bc..2f8ae05 100644 --- a/view/frontend/requirejs-config.js +++ b/view/frontend/requirejs-config.js @@ -2,7 +2,7 @@ var config = { config: { mixins: { 'Magento_Ui/js/lib/validation/validator': { - 'Flekto_Postcode/js/validation/validator-mixin': true, + 'PostcodeEu_AddressValidation/js/validation/validator-mixin': true, }, }, }, diff --git a/view/frontend/templates/customer/address/autofill.phtml b/view/frontend/templates/customer/address/autofill.phtml index 68b0412..8a07ba7 100644 --- a/view/frontend/templates/customer/address/autofill.phtml +++ b/view/frontend/templates/customer/address/autofill.phtml @@ -1,6 +1,6 @@ @@ -29,7 +29,7 @@