Back to Top

Magento 2 Recurring Payments and Subscriptions

Updated 22 April 2024

Introduction

Magento 2 Recurring Payment Subscriptions module provides the functionality to manage subscription & recurring payment for the products of the admin

Apart from that, the extension allows the customers to make a subscription for the allowed products on a daily, weekly, Monthly & Yearly basis.

Check the plugin’s configuration part – 

CW4_mzvK640

Check the plugin’s customer workflow part – 

r5QRXswmsnc

Recurring Payment for Magento 2 (Adobe Commerce) Features

  • The merchant can enable/disable the Recurring Payment.
  • The admin can manage PayPal Recurring payment.
  • Also, the owner can view/unsubscribe customer subscriptions.
  • Moreover, customers can view/unsubscribe to their subscriptions.
  • Additionally, it supports online recurring payments with PayPal.
  • Additionally, this module supports online Stripe recurring payments.
  • Even it supports offline recurring payments too
  • Further merchants can add more than one subscription product.
  • As well as the owner can select the subscription price scope as global or website wise.
  • Furthermore, the admin sets the subscription amount & subscription initial fee product-wise.
  • Magento 2 subscription extension supports simple, configurable, virtual, and downloadable product types.
  • Then, the merchant can manage the duration type.
  • The admin can allow customers to cancel and hold the subscription.
  • The admin can manage the subscription labels.
  • The admin can send an Email notification for subscription status.
  • The admin can add subscription cancellation reasons for customers.
  • The admin can add the terms for the child products of the configurable product.
  • Admin can check the subscription reports: Subscription revenue, active subscriptions, new subscriptions, subscriptions average, and churn rate.

    Searching for an experienced
    Magento 2 Company ?
    Find out More
  • Customers can choose the subscription cancellation reason to cancel the subscription.

  • Customers can check the recent transactions related to subscriptions.   

Magento 2 Recurring Payment Installation

Now, follow the below steps for installing the Magento 2 Recurring Payment extension –

Step 1:

first of all, Unzip the respective extension zip and then move the “app” folder (inside “src” folder) into the Magento (Adobe Commerce) root directory on the server.

magento 2 recurring payments installation

Step 2:

After that, run the below-mentioned commands in the Magento 2 root directory via terminal.

First Command –

composer require stripe/stripe-php:~7.40

Second Command –

php bin/magento setup:upgrade

Third Command –

php bin/magento setup:di:compile

Fourth Command –

php bin/magento setup:static-content:deploy

How to Get PayPal & Stripe Credentials?

PayPal Credentials

Now, Log in to PayPal business account and navigate through “Payment Setup”->

On your website”-> “continue” button.

screencapture-paypal-activation

Then, tap on “Option A” to select a third party e-commerce solution where the PayPal payment process is built-in.

after that, in Option A tap on the “Get your API Credentials” link.

paypal-activation-businessSetup2-2

Post this, click on the “Manage API Credentials” button to see API Credentials.

businessmanage-credentials-apiAccess

Now here, you can see your API Username, API Password, and Signature.

API-Signature-1

Stripe Credentials

To get the API Keys you can use the link- https://dashboard.stripe.com/login.

You have to Log in/Sign up your account and you will get your API Keys.

As you can see in the following screenshot the keys are there for the Test and live environmentsPublishable Key and the Secret Key.

stripe acc

Setting Up IPN Notifications on PayPal

Setting Up IPN Notifications on PayPal

The following method defines how to specify and activate the URL for your IPN listener in your PayPal profile.

Your listener must be located at the URL that you specify in the profile.

Before you activate your listener on PayPal, you should test the listener using the IPN simulator in the sandbox.

The steps to set up your listener for Sandbox testing and to set up your listener for live operation on PayPal are the same.

The only difference is that you log into the sandbox to set up your listener for Sandbox testing and you log into PayPal to set up your listener for live operation.

Note: 

Sandbox testing goes beyond simply using the IPN simulator. The IPN simulator only sends IPN messages to a listener; it does not perform the complete operation; for example, it does not complete a transaction.

Sandbox testing involves performing the same actions in the sandbox as you expect to be performed when the listener goes live.

Post that you log in, follow these instructions to set up your listener:

  1. Log in to your PayPal business account at www.paypal.com.
  2. Click the settings icon at the top of your PayPal account page and then click Account Settings.
  3. On the Notifications page, click the Update link for the Instant payment notifications item.
  4. Click Choose IPN Settings to specify your listener’s URL and activate the listener. The following page opens:
  5. Specify the URL for your listener in the Notification URL field.
  6. Click Receive IPN messages (Enabled) to enable your listener.
  7. Click Save. The following page opens:

You can return to the Instant Payment Notification page to modify your notification URL, disable your listener, or turn off IPN.

Note: 

IPN Url to be set: [magento-url]/recurring/paypal/notify

The IPN message is always sent to your notification URL unless you have disabled the preference to receive IPN messages.

Set Webhook in Stripe for Webkul Recurring Payments

In web development, a webhook is a method of altering the behavior of a web page, or web application, with custom callbacks.

Webhooks are basically user-defined HTTP callbacks that are triggered by specific events.

Now for setting up the Webhook in Stripe, follow the steps listed below-

Step1: Login to Stripe Account

webkul-magento2-recurring-subscription-login

Step 2

  • ‘View Test Data'(as per your need), and
  • Tick on ‘Developers’ thence
  • Go on ‘Webhook’. 
webkul-magento2-recurring-subscription-webhook

Step 3

Here, Add Endpoint.

webkul-magento2-recurring-subscription-add-point

Step 4:

Fill the details as shown in the screenshot and save details.

webkul-magento2-recurring-subscription-step-4

Step 5:

Go to the ‘Send Test Webhook’ to check the given URL is working or not.

Magento2 Recurring Payment Subscription - Dashboard – Whosthechef – Stripe Test

Now you can easily send a test event to a webhook endpoint, by selecting the specific event type & by clicking on the Send test Webhook button.

Magento2 Recurring Payment Subscription - Dashboard – Whosthechef – Stripe Test

Magento 2 Recurring Payment Configuration – Admin

After the successful installation of the extension, the admin will configure the module settings. To do so, the admin will navigate through Stores->Configuration->Webkul->Subscription Configuration.

General Settings

Here, the admin will be able to –

  • Enable the functionality by selecting a Yes option to select a NO for Disabling the functionality.
  • Select the Subscription Price Scope –  Select the scope for using the extension as  Global or Website wise.
  • Enable Discount on Subscriptions:  Select a Yes to apply discounts on subscriptions, it is valid only on the first order else select a No.
  • Allow Multiple Subscriptions in Cart: Select a Yes multiple subscription products can be added to the cart at a time. If their “Start Date and Duration types” are the same.
  • Allowed Payment Methods to Buy Subscription:  Here, choose the payment methods that will be available to customers for buying the subscription product.
general settings

Manage Customer Control Settings

  • Allow Customer to Cancel Subscription: Now the admin can allow their customer to cancel a subscription by enabling this feature.
  • Allow Customer to hold Subscription: The admin can allow their customer to hold subscriptions by enabling this.
  • Allow Customers to Subscribe multiple times for the same product: Now the admin can allow their customer to subscribe multiple times for the same products.
customer control settings

Manage Subscription Labels

  • Label for Without Subscription: The admin can type the name visible on the product page for purchasing without a Subscription.
  • Label for With Subscription: The admin can type the name visible on the product page for purchasing with Subscription.
  • Subscriptions Information Message: The admin can define information messages regarding the subscription.
manage subscription labels

User Email Reminder and Notification Settings

  • Send Email on Subscription Status: The admin can select subscription status and send an email notification to the customer.
  • Send Email Copy To: Here the admin can enter their preference email ID to send a copy of the mail.
  • Send Expiry and Renewal reminder mail days: The admin can set a reminder email days before to send expiry and renewal reminders.
email reminder and notification settings

Cancellation Reason for Customers

  • Add Cancellation Reasons for Customers: Here the admin can add and ask the reason for the cancellation subscription from the customer.

Configuration – Recurring PayPal Payment Method

Thereafter, the admin needs to navigate through Stores->Configuration->Sales->Payment Methods->Webkul Recurring PayPal Express Checkout Payment Method.

Here, the admin will configure the settings for the payment method as shown below in the snapshot.

paypal recurring

Here, the admin will –

  • Enable this solution for making it available for use at the frontend.
  • Sandbox Mode
    Select Yes to enable the testing mode else select No to make use of the Live mode.
  • Title
    Set the Title for the Payment method which is visible to the customers at the checkout page.
  • Merchant PayPal ID
    Enter your Merchant PayPal Id within the space provided.
  • PayPal API User Name
    Enter your PayPal User Name.
  • PayPal API Password
    Enter your PayPal password.
  • PayPal Client Id
    Enter your PayPal Client Id
  • PayPal Secret Key
    Enter your PayPal secret key
  • PayPal API Signature
    Enter your PayPal Signature
  • Payment From Applicable Countries
    Select All to allow payment from all the countries else select Specific Countries.
  • Payment From Specific Countries
    If Specific Countries is selected then you can select the specific countries from where you want to receive the payments.
  • Sort Order
    Set the sort order for this payment method at the checkout time.

Configuration – Recurring Stripe Payment Method

The admin will be able to configure recurring stripe payment method by navigating through Stores->Configuration->Sales->Payment Methods->Webkul Recurring Stripe Payment Method likewise shown in the image below:

stripe recurring

Here, the admin will-

Enable this Solution: Select Yes to enable this payment method else to select No to disable this payment method.

Title: Set the Title for the Payment method which is visible to the customers at the checkout page.

Sandbox Mode: Select Yes to enable the testing mode else select No to make use of the Live mode.

API Publishable Key: Enter your Stripe API publishable key.

API Secret Key: Enter your Stripe API secret key.

Payment from Applicable Countries: Select All Allowed Countries to allow payment from all the countries else select Specific Countries to allow payment from specific selected countries.

Minimum Order Total: Here, the admin needs to enter the minimum amount allowed by stripe.

Maximum Order Total: The admin can enter the maximum amount allowed by stripe.

Sort Order: Set the sort order for this payment method at the checkout time.

Recurring Payments – Admin

The admin will have the Recurring section in the admin backend panel thenceforward the successful installation of the Magento2 Recurring Payment Subscription extension. Merchant should have CRM Extension to retain customers.

dashboard menu

Here the admin has three sub-sections to manage:

Manage Duration Type

  • Here the admin can view and manage the duration type and add new duration by clicking on “Add Duration Type”.
duration type

After clicking “Add Duration Type” here the admin needs to fill and select for creation of new duration type.

  • Status: Here the admin can enable or disable duration.
  • Duration Title: The admin can enter the duration title.
  • Duration Type: Here the admin can select the subscription duration type such as Day, Week, Month, and Year.
  • Duration (Billing Cycle): The number of duration after which a subscriber is billed. For example, if the duration type is DAY with a duration of 2, the subscription is billed once every two days.
  •  Sort Order: Here the admin can enter the sort order.
  • Initial Fees: Set “Yes” if you charge the initial fee to the customer. It will only deducted at the time of the first purchase of the subscription.
new duration type

Manage Subscriptions

  • Under this section, the admin will find all the recurring subscriptions listed.
manage subscription

To view a subscription detail, tap the View link and you will be able to see the subscription information for that particular subscription.

The admin can unsubscribe from the particular subscription by clicking the “Unsubscribe” button.

subscription information

Under the Orders section, the admin can see the recurring payment details for the particular customer.

orders

Here, the admin can also cancel the customer subscriptions by selecting the subscription first and then from the Actions drop-down option select the Unsubscribe option as shown below in the snapshot.

unsubscribe

After this, the admin can see a pop-up for Unsubscribing the selected Subscription, click Ok to confirm.

unsubscribe popup

After this, the admin will see a confirmation message for the same.

unsubscribe susccessfull

Subscription Report

Here the admin can check their subscription report in dashboard format, such as Subscription Revenue, Active Subscription, Average Subscription Value, and New Subscription.

subscription report

How To Create a Subscription Product?

Note – This extension supports simple, configurable, virtual, and downloadable product types.

To create a subscription product you need to navigate to the Catalog section and open any already created or new product. After that, go to the Subscription Configuration section for the product.

Here, set the Subscription option to Yes. After that, you will have to click the Edit Configuration button to add the subscription duration to this product.

For Subscription Only Product: Set “Yes” if you want to make this product “Only” available for Subscription

product subscription configuration

This brings up the below section to choose the duration type for the product. Here, you need to check the subscription types to set for this product.

The admin needs to choose any duration title such as weekly, monthly, and yearly. Then they need to enter initial fee and need to select discount types and the final the admin will enter subscriptions charge.

subscription type edit

Lastly, click the Save button at the top to save the configuration settings.

save

Manage Subscription on Configurable Products

Now the admin can manage subscription on configurable products the admin needs to click on “Catalog>Products>Need to click edit on configurable types of Products<Subscription Configuration>Edit Configuration”.

Here the admin can choose configurable products and manage their subscription.

configurable product subscription

After clicking on “Edit Configuration” then admin needs to click on “Manage Subscription”.

The admin must select a duration title, such as weekly, monthly, or yearly. Following that selection, they are required to input an initial fee and choose from various discount options. Finally, the admin will input the subscription charge.

configurable product subscription type

Customer Workflow

Magento 2 Recurring Payment Subscription advances the website front, the customer will see a Login to Continue button.

Screenshot-16-2

After clicking the Login To Subscribe button, the user needs to login to his account on the website. And after which the customer can see the Subscribe button as shown below in the snapshot.

Then customer needs to click“Subscribe Now” the products after selecting thier plan, quantity and date.

Screenshot-17-2

Click the Proceed to Checkout button to proceed to the checkout.

Screenshot-18-2

Now, select your shipping address, shipping method and tap the Next button.

Magento2 Recurring Payment Subscription_checkout_page-1

Under the payment section, the customer can select to either to go with the Check/Money Order(offline method for purchasing the subscription).

Or PayPal Recurring Payment(Online Payment) method or Stripe Recurring Payment(Online Payment).

PayPal Recurring Payment: 

Post this, click the Place Order button.

Screenshot-19-

Post the above step, the customer is redirected to the PayPal login. The customer has to login to his PayPal account.

Screenshot-20-

Post that, select Accept and Continue to complete the payment for this particular order.

Magento2 Recurring Payment Subscription - paypal_make_payment_page

Stripe Recurring Payment: 

Now the customers can also able to view the Stripe Recurring Payment method under the payment section. Post this, click the Pay With New Card button.

Magento2 Recurring Payment Subscription - Stripe recurring payment method

Tapping to Pay With New Card button, the customer is redirected to the Stripe login. The customer has to login to his Stripe account.

Screenshot-21

And then, select Accept and Continue to complete the payment for this particular order.

Note: Stripe recurring payment method only shows over the payment page if the subscription is selected from the current date.

Lastly, the customer can see the placed order details. Hence for more details check the below given snapshot.

Screenshot-24-1

Here, the customers need to click “My Subscription” then they can see the overview of the subscriptions they have subscribed to and can view/Unsubscribe the subscription as well.

Screenshot-25

To view the subscription, tap the view button and you can see the details of the particular subscription.

Here the customer can hold and unsubscribe the subscription.

Screenshot-26

Now, The customers also have an option to unsubscribe to the opted subscriptions.

Afterwards, to do so, the customer will tap on the Unsubscribe button that brings up a pop-up to select the reason for cancellation.

Thereupon tap the OK button to confirm the unsubscribe.

Screenshot-27

Next tapping the OK button you can see that the subscription status is unsubscribed.

Screenshot-29

The customers can also check the Billing information by tapping on the Billing info section.
It displays several information such as Amount to be billed, Initial Fee, Next Billing Date, Last Billing Date etc.

billing info

Subscription Emails

The customers will get subscription email on every new subscription.
It will contain details such as Transaction ID, Product details like Item, SKU and Quantity as well.

A reference screenshot of a New Subscription Email is provided below,

Run the following command for sending a reminder Email to the customer before their subscription expires,

php bin/magento cron:run --group default

If the customer cancels any existing subscription, they’ll notified through Email for the cancellation as well.

Support

That’s all for the Recurring Payment Subscription for Magento 2 (Adobe Commerce) extension. If you have any queries or doubts get back to us on [email protected] or raise a ticket at webkul.uvdesk.com

Explore the Adobe Commerce Cloud development service by Webkul. You may also browse other Magento 2 marketplace add-ons. Also our quality Magento 2 extensions.

Current Product Version - 4.0.5

Supported Framework Version - Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


6 comments

  • Aishwarya Sharma
    • Subhangi (Moderator)
  • Issa Fakhoury
    • Subhangi (Moderator)
  • ali
    • Subhangi (Moderator)
  • Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home

    Table of Content