GithubHelp home page GithubHelp logo

akitogo / melissaaddressvalidator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 42 KB

Magento 2 Extension for validating postal addresses using Melissa Data api service

License: MIT License

PHP 49.41% JavaScript 36.20% CSS 2.28% HTML 12.11%
php magento2-extension address-validation

melissaaddressvalidator's Introduction

Akitogo Melissa Address Validator for Magento 2

Magento 2 Extension for validating postal addresses using Melissa Data api service.

Please note that this module requires a valid api key from Melissa Data to work, please check https://www.melissa.com/developer/

If you find any bug, feel free to submit a pull request or file a bug report. If you are interested in commercial support, please get in touch with Akitogo. Please check https://www.akitogo.com/blog/address-validation-for-magento-2-with-melissa-data

The extension is as well officially available at the Magento Marketplace https://marketplace.magento.com/akitogo-melissa-address-validator.html

Please note

If your theme uses a custom button/mechanism for triggering place order, the triggerPlaceOrder function has to be overridden accordingly.

Please do: Create a Mixin (app/design/frontend/<Vendor>/<Theme>/web/js/mixins/melissa-address-validator.js) For Mixins see: https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_mixins.html

Add mixin to melissa validator js (app/design/frontend/<Vendor>/<Theme>/requirejs-config.js)

var config = {
    config: {
        mixins: {
            'Akitogo_MelissaAddressValidator/js/validator': {
                'js/mixins/melissa-address-validator': true
            }
        }
    },

In this example we have a custom methods and buttons for placing order - we are looking for button with different classes that have _active class:

Example

COMPOSER INSTALLATION

  • run composer command:

$> composer require akitogo/melissa-address-validator

MANUAL INSTALLATION

  • extract files from an archive

  • deploy files into Magento2 folder app/code/akitogo/MelissaAddressValidator

Versions

  • 1.0.3 16th November 2021 fixing bug with default Magento theme and multiple payment methods
  • 1.0.2 9th June 2021 no code changes, just checked compatibility with 2.4
  • 1.0.1 21st July 2020 fixing api response handling
  • 1.0.1 15th July 2020 Initial release

About Akitogo

We are specialised in developing customized e-commerce solutions based on Magento.

Are you interested in Melissa's solutions?

Do you have any further questions? Then get in touch via [email protected] or call us Melissa Data at +49 (0)221 97 58 92 40. You are also welcome to visit www.melissa.de.

About Melissa

Melissa is a leading provider of data quality, identity verification and address management solutions. Melissa supports companies in customer acquisition and in the validation and correction of contact data, in the optimization of marketing and sales processes ROIs and risk management. Since 1985 Melissa has been working for companies like Mercury insurance, Xerox, Disney, AAA and Nestlé a reliable partner in the improvement customer communication.

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

melissaaddressvalidator's People

Contributors

akislawek avatar gunnarlieb avatar

Watchers

 avatar

Forkers

toh82

melissaaddressvalidator's Issues

Guzzle sends request without body

It seems this is a bit outdated:

            $request = $client->request(
                Request::HTTP_METHOD_POST,
                self::API_REQUEST_ENDPOINT,
                [
                    'json' => $params
                ]
            );

if I run this, the body for the request within \GuzzleHttp\Client::requestAsync is always empty because it can't find $options['body'] also there it tries to set the headers which are empty, too $headers = $options['headers'] ?? [];

Besides this, currently the request to Melissa, even if the above is adjusted, returns GE08 (my API Key is actually allowed to do the request, we checked the config) so I wonder if the request has an additional problem somewhere.

I adjusted the code above like this, dunno is it's completely correct

            $request = $client->request(
                Request::HTTP_METHOD_POST,
                self::API_REQUEST_ENDPOINT,
                [
                    'headers' => [
                        'Accept' => 'application/json'
                    ],
                    'body' => json_encode($params)
                ]
            );

Magento 2.4

Checking to see if your extension is compatible with the current version of Magento 2.4.1? Magento Marketplace version displays 2.3 only.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.