Giter Site home page Giter Site logo

thomas-kl1 / magento2-payment-method-availability Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 12 KB

[ARCHIVED] This module allows you to define payment method availability dynamically in Magento 2.

Home Page: https://thomas-kl1.github.io/magento2-payment-method-availability

License: MIT License

PHP 100.00%

magento2-payment-method-availability's Introduction

Payment Method Availability

Latest Stable Version License: MIT

This module allows you to define payment method availability dynamically. The free source is available at the github repository.

THIS REPOSITORY HAS BEEN ARCHIVED.
PLEASE, READ THE "DEVELOPERS" SECTION. THIS MODULE IS A FALSE ANSWER TO A FALSE PROBLEM.

Setup

composer require tklein/module-payment-method-availability

Go to your Magento root, then run the following magento command:

php bin/magento setup:upgrade

If you are in production mode, do not forget to recompile and redeploy the static resources, or to use the --keep-generated option.

Settings

Customize the module without efforts.

Administrators

The following settings are available at Stores > Configuration > Sales > Payment Methods > Other Payment Methods > Default Payment Method Settings:

  • Payment Method Availability: Manage the payment methods availability with the minimum and maximum allowed amount.

Developers

Please see the following API first, maybe it could resolve your issue:

    <type name="Magento\Payment\Model\Checks\SpecificationFactory">
        <arguments>
            <argument name="mapping" xsi:type="array">
                <item name="country" xsi:type="object">Magento\Payment\Model\Checks\CanUseForCountry</item>
                <item name="currency" xsi:type="object">Magento\Payment\Model\Checks\CanUseForCurrency</item>
                <item name="checkout" xsi:type="object">Magento\Payment\Model\Checks\CanUseCheckout</item>
                <item name="internal" xsi:type="object">Magento\Payment\Model\Checks\CanUseInternal</item>
                <item name="total" xsi:type="object">Magento\Payment\Model\Checks\TotalMinMax</item>
                <item name="zero_total" xsi:type="object">Magento\Payment\Model\Checks\ZeroTotal</item>
            </argument>
        </arguments>
    </type>

Where the specifications implements the following interface: \Magento\Payment\Model\Checks\SpecificationInterface.

In the case of the gateway API, please refer to the validator pool:

Magento\Payment\Gateway\Validator\ValidatorPool

Support

Authors

Licence

This project is licensed under the MIT License - see the LICENSE file for details.

That's all folks!

magento2-payment-method-availability's People

Contributors

thomas-kl1 avatar

Watchers

 avatar  avatar

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.