Download the PHP package smaex/additional-payment-checks without Composer

On this page you can find all versions of the php package smaex/additional-payment-checks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package additional-payment-checks

Magento 2: Additional Payment Checks

Enables additional checks for payment methods in Magento 2.

Intro

Adding additional checks to payment methods – to decide if a certain payment method is applicable to a certain customer or not – is pretty easy and straight forward in Magento 2.

Magento provides a rather simplistic interface for custom payment method checks, and uses a composite check to process these individual checks. Adding a custom check is therefore just a matter of injecting it into Magento’s composite check via dependency injection.

Well, at least in an ideal world. But since we’re talking about Magento here, it’s geting a bit more messy complex. Different checks might be necessary in different scenarios, so Magento uses a factory to instantiate its composite check dynamically with a varying list of checks in different places.

However, and in typical Magento fashion, this mechanism is only half baked. Magento uses a class called MethodList to retrieve applicable payment methods, and hardcodes the list of checks that are performed to figure out which payment methods to offer.

Fortunately, this extension provides a handy workaround.

How to install

Simply require the extension via Composer.

Finally, enable the module via Magento’s CLI.

How to use

The extension plugs into the factory’s create-method and extends the list of checks that is passed to Magento’s composite check upon creation. All we have to do now, besides injecting our custom check into the factory as described above, is adding it to the plugin provided by this extension.

For a real-life example, check out smaex/customer-group-payments as well.

We’re hiring!

Wanna work for one of Germany’s leading Magento partners? With agile methods, small teams and big clients? We’re currently looking for experienced masochists PHP & Magento developers in Munich. Sounds interesting? Just drop me a line via [email protected]


All versions of additional-payment-checks with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
magento/module-payment Version ^100.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package smaex/additional-payment-checks contains the following files

Loading the files please wait ....