Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    magento-hyperlocal-marketplace-guide

    Magento 2 Recurring Payments and Subscriptions

    Introduction

    Magento 2 Recurring Payment Subscription: This module provides the functionality to manage subscription & recurring payment for the products of the admin.

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

    Magento 2 Recurring Payment 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.
    • This extension supports simple, configurable, virtual, and downloadable product types.
    • Then, the merchant can manage the duration type.

    Magento 2 Recurring Payment Installation

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

    Step 1:

    Unzip the respective extension zip and then move the “app” folder (inside “src” folder) into the Magento root directory on the server.

    Step 2:

    Now, run the below mentioned commands in the Magento 2 root directory via terminal.

    First command –composer require stripe/stripe-php

    Second Command -php bin/magento setup:upgrade

    Third Command – php bin/magento setup:di:compile

    Fourth Command – php bin/magento setup:static-content:deploy

    Step 3:

    lastly, flush the cache and re-index all by navigating through System->Cache management.

    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.

    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 “Get your API Credentials” link.

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

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

    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.

    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

    Step 2

    • ‘View Test Data'(as per your need), and
    • Tick on ‘Developers’ thence
    • Go on ‘Webhook’. 

    Step 3

    Here, Add Endpoint.

    Step 4:

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

    Step 5:

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

    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.

    Magento 2 Recurring Payment Configuration – Admin

    Magento 2 Recurring Payment and Subscription

    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.

    Here, the admin will be able to –

    • Enable the functionality by selecting a Yes option else 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.

    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.

    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 API Signature
      Enter your PayPal Signature
    • Payment Form Applicable Countries
      Select All to allow payment from all the countries else selects Specific Countries.
    • Payment From Specific Countries
      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:

    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.

    Set Name Display on Form: Set the Name for the Payment method which is visible to the customers at the form while entering the card details.

    Payment from Applicable Countries: Select the specific countries from where you want to receive the payments

    Minimum Order Total: Here, the admin needs to enter the minimum 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. Merchnat should have CRM Extension to retain customers.

    Here the admin has two sub-sections to manage:

    • Manage Duration Type Under here, the admin will be able to create the subscription duration.

      To create a new duration type, tap the Add Duration Type button. You can create the duration type as – daily, weekly, Monthly & Yearly basis.
      Also, after you have created a subscription duration, no other same duration type can again be created. If you try creating one, you will get an error message as shown below in the snapshot.
    • Manage Subscriptions

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

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

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

    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.

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

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

    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.

    This brings up the below section to choose the duration type for the product. Here, you need to check the subscription duration types to set for this product, enter the Subscription Title, Description(for a visible understanding), set an Initial Fee, and the subscription Charges applicable for the different chosen duration types.

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

    Customer Workflow

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

    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.

    Tapping the Subscribe button will bring up the section to select any of the listed subscription plans. The customer can choose a plan that suits him best.

    Here, the customer can see the details of the plan like – Name, description, Start Date, Initial Fee, Subscription Charges and a Subscribe Now button.

    The customer has to select the start date for the subscription plan. Then click on the Subscribe Now button to proceed further.

    This adds the product to the cart. You can also check the subscription details in the cart by scrolling.

    Customers can add more than one subscription product.

    Note: The date and duration type will be the same.


    If the date and duration type will not be the same, it shows like the below image.

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

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

    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.

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

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

    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.

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

    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.

    Forthwith, to check the subscription details, the customer can navigate to My Subscription section. This sections is under the account panel as shown below in the snapshot.

    Here, the customers can see the overview of the subscriptions they have subscribed to and can view/Unsubscribe the subscription as well.

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

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

    Afterward to do so, the customer will tap on the Unsubscribe button and that brings up a pop-up confirmation for the same.

    Thereupon tap the OK button to confirm the unsubscribe.

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

    Support

    That’s all for the Magento 2 Recurring Payment Subscription extension. If you have any queries or doubts get back to us at support@webkul.com or raise a ticket at webkul.uvdesk.com

    Current Product Version - 3.0.1

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

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close

    Table of Content

    Hide Index