Download the PHP package cardgate/magento2 without Composer

On this page you can find all versions of the php package cardgate/magento2. 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 magento2

CardGate

CardGate module for Magento 2

Total Downloads Latest Version Build Status

Support

This plugin supports Magento 2.1.x - 2.4.x.

Preparation

The usage of this module requires that you have obtained CardGate RESTful API credentials. Please visit My CardGate and retrieve your credentials, or contact your accountmanager.

Installation

The CardGate Module for Magento 2 is installed via Composer.

  1. Go to Magento 2 root folder.

  2. Enter following commands to install module:

    Wait while dependencies are updated.

  3. Enter following commands to enable module:

  4. If Magento is running in production mode, deploy static content:

Configuration

Subscriptions (CuroPayments recurring)

This module can sell products as recurring subscriptions. The first order is paid normally by the customer; every following billing cycle is charged automatically through the CuroPayments recurring entry point, without customer interaction:

See the CuroPayments documentation for the entry point details. The initial (authorizing) transaction of the order acts as the mandate for all following recurring charges.

1. Setup

  1. Install/upgrade the module and run php bin/magento setup:upgrade (creates the cardgate_subscription table and the product attributes) followed by php bin/magento cache:flush.
  2. Make sure the Magento cron is running (bin/magento cron:run from the system crontab). Subscription billing uses its own cron group cardgate (see etc/cron_groups.xml), so throttled settings of the default group do not delay billing.
  3. Enable at least one of the allowed payment methods (see below).

2. Making a product a subscription

setup:upgrade adds three product attributes (group CardGate Subscription), available for every product type (simple, configurable, bundle, grouped and virtual):

Attribute Code Meaning
Sell as Subscription cardgate_is_subscription Yes = buying this product starts a subscription
Subscription Interval Count cardgate_subscription_interval Number of units between charges (minimum 1)
Subscription Interval Unit cardgate_subscription_interval_unit day, week, month or year (default month)

Example: count 3 + unit month = billed every three months.

3. Cart and checkout rules

4. How a subscription is created

  1. The customer places the order and pays the initial transaction at CardGate.
  2. When the CardGate callback confirms the payment, the CardGate transaction id of the order is stored as the mandate and a subscription record is created for the subscription line-item (the sales_order_place_after observer tries too, but at that moment there is no mandate yet). Creation is idempotent: one subscription per order + product.
  3. The subscription stores:
    • amount: row total incl. tax of the subscribed line-item;
    • shipping amount: the order shipping (incl. tax), scaled to the cycle length (cycle days / 30, limited between 0.25x and 2x);
    • currency, quantity, interval, payment method and mandate;
    • next billing date (next_run_at): order date + one interval, at 00:00 (UTC).

Renewal orders (created by a subscription) never create a new subscription.

5. Automated billing

The cron job cardgate_process_subscriptions runs every 5 minutes and picks up all active subscriptions whose next_run_at has passed. For each of them:

  1. If skip next is set, the flag is cleared and the cycle is moved forward one interval without charging.
  2. Otherwise a renewal order is created: a copy of the subscribed line-item of the originating order, with the same customer, addresses, shipping and payment method.
  3. The renewal order is charged through the recurring entry point using the mandate, the order grand total and the order increment id as reference.
  4. The regular CardGate callback then captures and invoices the renewal order just like a normal order.
  5. On success cycles_billed is increased, last_order_id / last_transaction_id / last_run_at are stored, failures are reset and next_run_at moves one interval forward.

6. Failures and retries

Failure What happens Next attempt
Renewal order could not be created (gateway not contacted) failure_count +1, last_error stored 15, 30, 60, 120 ... minutes (max 240)
Gateway charge failed Renewal order is cancelled with a comment, failure_count +1, last_error stored 1, 2, 4, 7, 7 days (start of day)

After 5 consecutive failures the subscription is set to paused for review. Check last_error in the admin and var/log/exception.log / var/log/debug.log, fix the cause and resume the subscription.

7. Statuses

8. Customer self-service (My Account → My Subscriptions)

Logged-in customers can, for their own subscriptions:

9. Administration (Sales → Operations → CardGate Subscriptions)

Requires the ACL resource Sales → CardGate Subscriptions (Cardgate_Payment::subscriptions); grant it under System → Permissions → User Roles for non-administrator roles.

The grid lists all subscriptions. On the edit page an administrator can change:

10. Troubleshooting

Testing

The module ships with a PHPUnit test-suite that runs on PHP 7.4 up to 8.3.

phpunit.xml uses the PHPUnit 10/11 schema and tests/bootstrap.php registers a small PSR-4 autoloader so the standalone unit tests run without a full Magento installation. PHPUnit ^10.5 || ^11.0 is declared under require-dev, both of which support PHP 8.3.

Requirements

No further requirements.


All versions of magento2 with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 cardgate/magento2 contains the following files

Loading the files please wait ...