Child pages
  • Subscription and Recurring Payments - Magento 2
Skip to end of metadata
Go to start of metadata


FireFox user notice:

Please use different web-browser for viewing this document.

Sorry for the incoivenenice.

Thank you for choosing Aheadworks!


Installing Subscription and Recurring Payments

To install the extension follow the instructions below:

1. Backup your web directory and store database

2. Download Subscription and Recurring Payments installation package

 3. Upload contents of the Subscription and Recurring Payments installation package to your store root directory

 4. In SSH console of your server navigate to your store root folder:

cd path_to_the_store_root_folder


php -f bin/magento module:enable Aheadworks_Sarp


php -f bin/magento setup:upgrade


php -f bin/magento setup:static-content:deploy

5. Flush store cache; log out from the backend and log in again


Make sure the installation is done from under the FTP administrator account. Otherwise make sure to set 775 permissions to the store root directory after the extension is deployed.


Payment Gateway Configuration


1) Log in to Admin > Stores > Configuration > Sales > Payment Methods and find Authorize.Net.

2) Set "Enabled" to "Yes".

3) Fill "API Login ID", "Transaction Key", "Merchant MD5" fields. You need to create a merchant account at Authorize.Net. Follow the instructions given at Authorize.Net side.

4) Once the Authorize.Net account is created navigate to Account > Settings > Silent Post URL

Set the Silent Post URL as:

Make sure to save the changes made.



1) Log in to Admin > Stores > Configuration > Sales > Payment Methods > Stripe(Subscriptions).

2) Fill "Live Secret Key", "Live Publishable Key". You need to create a merchant account at Stripe. Follow the instructions given at Stripe side.

When the account is created this data can be obtained from "Api" tab.

3) At your Stripe account page navigate to Webhooks > Settings:

  • click "Add endpoint..." button
  • set URL as "" and set "Mode = Live/Test".

Make sure to save the changes made.



Adyen has extensive documentation on installing the payment method to Magento 2 store which can be found here:

Below we will describe in short how to make this happen.

1) Install Adyen extension at your store as another Magento 2 extension, including upgrade/deploy.

The package can be obtained from:

2) Install Adyen library via composer:

composer require adyen/php-api-library

3) Create account at Adyen. Make sure you have received the Account and Username infromation to your email.

4) Set up the account as described in the Adyen documentation here.

5) And set up the store as per documentation:

  • "Required Settings" tab: fill in Merchant Account (Adyen > Accounts > Account Code);
  • "Required Settings" tab: set up Test/Production Mode;
  • "Required Settings" tab: fill in Notification User Name/Email (these are the Adyen credentials);
  • "Required Settings" tab: fill in Webservice username/Email for Test (Adyen > Settings > Users > select Web Service user > User Account Details: User Name/Password);
  • "CreditCard API integration" tab: fill in Enter CSE Public Key of Test Adyen Web Service User (Adyen > Settings > Users > select Web Service user > Easy Encryption: Client Encryption).

Make sure to save the changes made.


Introducing Subscriptions and Recurring Payments

Subscription and Recurring Payments extension adds an option to purchase products as subscriptions:

  • Payments processed via external payment gateways (PayPal express, Authorize.Net, Adyen and Stripe currently);
  • Checkout with multiple subscription products at the same time;
  • Configurable and bundle products support;
  • Trial and initial fees for the subscriptions;
  • Multi-store and multi-lingual;
  • Adjustable billing and shipping subscription addresses.

The extension allows store owners to offer regular products as subscriptions. The extension does not convert products into subscriptions, instead it adds an option to checkout with product as a regular item or as a subscription. Depending on the extension settings, store owners can decide if they want to offer products as subscription-only or let their customers choose whatever delivery type they want.

Subscription profiles created within an extension are shared across all the products. Per single subscription plan store owners can configure: number of payments, recurring settings (daily, weekly, monthly, every X days), pricing settings, and description. All other settings are available on the product level.

Whenever the subscription plans configured 'Subscribe' button becomes available at the corresponding product pages. Subscription products are added to the subscription cart, not to interfere with the native checkout process. Subscription checkout is transparent and represented as four steps with the progress bar, customers should take to place an order. Though the steps customers can look around and read detailed information on the subscription plans available, select required shipping options, and specify billing and shipping addresses, just as with the native checkout.

Upon placing an order, customers are redirected to the payment gateway side, where the recurring profile is created. After, customers will be charge every X days set in the subscription plan and orders will be created automatically at the Magento side, available for processing by the store administrator.


Getting Around

Once installed, the extension introduces its pages to the Sales section of Magento 2 navigation menu. From here, store administrator has an access to the following pages:

  • Subscriptions - main subscription management screen, that lists all active subscriptions at the store with an overview of the most important subscription attributes;
  • Subscription plans - a section with a list of subscription plans, where store administrator creates and manges subscription plans.

These two section are the parts of Subscription and Recurring Payments "control center". When the extension is properly configured all the subscription management takes place here.

In addition to Sales section, the extension introduces its general configuration options to Stores > Configuration > Aheadworks extensions > Subscription and Recurring Payments. Configuration options control basic extension aspects.


Sections in this user guide are represented in an order preferred for setting up the extension. It starts with creating subscription plans, setting up existing products for subscriptions, configuring general extension settings, getting acquainted with the process of subscribing to products,and managing subscriptions from both store back- and frontend. If you are new to the extension we advise you to follow the user guide as it goes in order to get understanding of how to work with the extension on your own.

Creating subscription plans

Plan grid

Subscription Plans is the section one starts with to set up the extension. All the basic information about how the subscriptions work and will work per your requirements can be found here. It can be found under Sales > Subscription and Recurring Payments by Aheadworks > Subscription plans.

Subscription Plan is the basic element of the extension. Once created, subscription plans are shared among all the products with subscription options set. It defines how many times customers will be charged, time interval of the subscription payments and other necessary information.

This is the section where store administrator creates and manages subscription plans. It is represented with the grid listing all the subscription plans ever created, both enabled and disabled. The grid comes with the following control elements, that are shared across all other grids alike in the Aheadworks products:

  •  button allows customizing the grid look by hiding, applying columns. Some columns may be excessive and some relevant to the current tasks;
  •  button allows looking for particular subscription plan depending on the filters selected. Filters include all available subscription plan attributes;
  •  button allows saving the perfect grid look to quickly load it whenever required.

New Plan

To create new subscription plan click button.

New Subscription plan page setting are thematically split into four blocks: General Information, Schedule, Additional Pricing Settings, Storefront Description.

General Information

As it follows from it's name, the block lists common plan settings:

  • Status - allows enabling/disabling subscription plan;
  • Website - defines a website the plan should be available at;
  • Name - allows defining a subscription plan name for internal identification purposes.
  • Subscription engine - allows selecting a payment method available for the subscription plan.


The block controls the most important aspects of the subscription plan - how many times and at what intervals customers will be charged, along with the subscription start date:

  • Number of Payments - defines how many times customers will be charged (the number of orders created accordingly);
  • Repeat Payments - defines how ofter customers will be charged:
    • Setting values depend on the selected payment gateway.
  • Subscription start date - defines if subscription will start at the moment of purchase, exact day of month, last day of current month, or on the date defined by customer.

Total subscription period = Number of Payments * Repeat Payments


Stripe payment method only supports infinite subscription plans. Meaning that the product will be ordered for every set time interval until subscription is canceled.

Additional Pricing Settings

This section controls all additional subscription plan payment options:

  • Enable Initial Fee - defines if the initial fee is enabled for this subscription plan. Initial fee value is set on the product level;
  • Enable Trial Period - defines if the trial period is enabled for this subscription plan. Trial Period price is set on the product level.
  • Number of Trial Payments - defines the number of trial period payments in this period. Make sure to enter the value that doesn't contradict Number of Payments setting.

Storefront Description

In this section store administrator sets the subscription plan name and description that will be displayed to the customers at the store frontend:

  • Store View - defines the store view this plan title and description will be displayed at;
  • Title - name of the subscription plan;
  • Description - subscription plan description that supports HTML where store administrator is suggested to describe subscription options and benefits.

Additional store view descriptions can be added by clicking button.


Once every plan setting is configured store administrator can click button to proceed to the product configuration.


Product configuration

Once at least a single Subscription Plan has been created and configured, it is possible to start offering products by subscription. The extension doesn't add new product type with a limited set of options to the store, instead it allows store administrator to offer existing products as subscriptions.

Subscription settings are added to all product types (except grouped products) and can be found in the Subscription Configuration section of the product details page.


The extension does NOT work with grouped product type.


There is a total of four settings:

  • Subscription - defines if the product should be distributed as a single time purchase, only as a subscription, or available for both: subscription and a single purchase;
  • Regular Payment Price - defines the price of a regular subscription payment. If the Regular Payment Price is lower than an original product price, the %-difference can be displayed at the product page (will be covered later);
  • Trial Price - defines the price of single subscription period if the trial is available;
  • Initial Fee - defines an initial fee that customer will have to pay upon placing a subscription order. It is a single payment that is processed separately.

The extension defining option is, of course, Subscription, as it defines if the product is available on recurring basis. The option is disabled by default for all products.

For configurable products, such options can be configured per item, meaning that you can define different Regular Payment Prices for different product configurations.


Extension log

Starting with version 1.3.0 the extension comes with the Subscription Log that stores all the subscription updates and customer and store administrator actions.

The log comes with the same control elements as the Subscription Plans grid, that allow for particular entries search and filtering.

In case the log needs to be cleared the store administrator uses button.


General settings

That's right, only now we will proceed to the General Settings of the extension, as there require understand of the basic subscription principles and terms. The settings can be found under Stores > Configuration > Aheadworks extensions > Subcription and Recurring Payments.

The settings define how the extension behaves when dealing with taxes and how it should look like on the store frontend:

  • Apply Tax on Trial Amount - defines if product taxes should be applied to the trial period payments of the extension;
  • Apply Tax on Shipping Amount - defines if product taxes should be applied to the shipping amount when customer decides on the shipping options;
  • Display "You Save X %" on Product Page - defines is %-difference between original item price and subscription price should be displayed at the 'Subscribe' button on the product page;
  • Tooltip Near Subscription Button on Product Page - allows displaying a tooltip for the subscription option below the 'Subscribe' button at the product pages;
  • Keep Log for, days - defines for how many days the extension log is kept.


Store front

Subscription product

If you are reading this userguide section, you have probably added subscription options to at least one product. Depending on the subscription options selected the subscriptio will look something like this:

Here is the product with Subscription option set to 'Optional', meaning it allows purchasing a product as both, single item and a subscription. Such products will have two buttons displayed at once: Add to Cart and Subscribe.

Native price attribute of this product has been set to $15, while the subscription price set to $12,5. That's it why one can see that subscribing to this product supplies will save 16% total. This, and because option Display "You Save X %" on Product Page of the General Settings has been set to 'Yes'.

The product at the image above is the configurable product, child products of the configurable one may have individual Subscription Price set to all of them, and while switching parent product options the 'Subscribe' button will always display relevant discount customer gets.

Checking out

All subscription products are added to the subscription cart, it is a dedicated shopping cart for the subscriptions. This dedicated cart has been introduced to avoid issues with the payment gateways, as most of the payment processors can either process a single-time payment or create a recurring profile.

When customer clicks 'Subscribe' button they are redirected to the Subscription Cart/Checkout page:

The Subscription Cart page represents a progress bar of four steps which indicate the checkout process.

  • At the first step customers are suggested to select the subscription plan. The plans come in individual blocks that are automatically adjusted to the screen borders. Each block contains subscription plan Title and Description. In addition, customers can click 'See more details' below the button to get comprehensive overview of all the subscription terms.
  • Upon clicking button, customers proceed to the second checkout step. Here customers are represented with the subscription total overview for the first order. This step has been introduced to secure customer's choise on the subscription and its start date. When everything is considered, customer clicks button to proceed to the third step.
  • The third step is the step of the native Magento 2 checkout, where customers are suggested to leave their Shipping and Billing addresses and decide on the shipping method.
  • The fourth step is the payment confirmation.

Once the subscription order has been placed, customer can navigate to his account at the store to check all the active subscriptions.

Customer account section

The extension introduces My Subscriptions section to customer account dashboard. The section lists all the customer's subscriptions active or expired.

Looks like our test customer has subscribed to weekly delivery of the Shoulder Packs for three months! An interesting decision. We should probably give props to the store owner who thought it was a great idea to offer shoulder packs by subscription.

From this page, by clicking 'View' link of the required subscription customer can go indepth to look for all associated orders and adjust billing and shipping information, in case the shoulder pack should be delivered to another address.

Subscription details page also allows customers to Suspend and Cancel subscription anytime required.


Store back

Every time customer subscribes for the supplied a dedicated entry is created at the Sales > Subscription and Recurring Payments by Aheadworks > Subscriptions grid.

Here store administrator is represented with an overview of all active, suspended, cancelled and expired subscriptions. With the Actions block, store administrator can also cancel and suspend selected subscriptions.

By clicking a Subscription Profile ID store administrator can check all the orders associated with the subscription and all other details just like with native Magento order details page.

Working with Adyen

When working with Adyen subscriptions, the store owner must consider the following:

1) If the subscription is NOT infinite, then disregarding the time suspended, the specified number of cycles (payment periods) will be processed.


For example:

Customer subscribed for 6 months. Subscription has been active for 3 months, then customer took a 3 month break. After the subscription is reactivated, customer will still have 3 more month of subscription and will be charged accrodingly.

2) The payment dates will not be transitioned to the end of the period after the subscription is reactivated.


For example:

There are two payments planned for 10th and 20th of the month.

10th payment is processed and customer suspends the subscription for 5 days.

On the 15th customer reactivates the subscription.

On the 20th customer is charged with another payment.

3) Considering the two peculiarities above, whenever customer suspends and reactivates the subscription, the missed billing cycle is transferred to the closest planned billing date.

Meaning that all the missed billing periods are placed in the queue and are processed regularly.

You can always find the latest version of the software, full documentation, demos, screenshots and reviews at
License agreement:
Contact Us:
Copyright © 2017 aheadWorks Co.

  • No labels