Changing the Subscription Option for the PayPal Payment Module in Drupal 7

Introduction

HookSupport is a platform facilitating the development of Drupal sites through on-demand Drupal support services. HookSupport provides Drupal development and support service as hourly packages. Starting from 5 hours per month, HookSupport offers a range of options that a client could purchase from depending on their requirement.

Pain Areas

A key requirement for the platform was the need to upgrade or downgrade these subscription plans. We used PayPal, one of the leading payment gateways for online payment1. The feature to upgrade, downgrade or even cancel the subscription2 chosen was not available with the Paypal module.

 

 

Approach

The tools and platforms used were the following

  • Drupal 7
  • PHP
  • Font Awesome
  • Google Font API
  • TrackJS
  • jQuery 1.11
  • Bootstrap Framework

Modules used in the project were the following

  • Products
  • Drupal Commerce
  • Commerce PayPal
  • PayPal Subscription

Challenges Faced by us and Solutions

Downgrade/Upgrade Existing PayPal Subscription

The website contained a lot of subscription plans. If a client needed to change the existing plan, Paypal did not provide the feature of modifying the existing recurring profile. Our solution was to let the client choose another subscription product from the portal and make the payment, during which time, a request will be sent to Paypal for canceling the previous plan.

 

 

Cancel Subscription Plans from Website / PayPal account

The PayPal Subscription module did not have the feature to manage cancellation. So we implemented the feature to cancel PayPal subscriptions. This can be done from the HookSupport dashboard or the PayPal account which automatically updates the other without having to cancel from both. This included canceling the order when the recurring subscription was canceled from the PayPal account by the client which also prevented it from recurring the next time.

Recurring Automatic Payment for Subscription Plans

For the subscription plan, the client does not need to initiate the payment process every month but the amount will get credited automatically.

Results

This project helped the client to change the plans without any effort and time. The client did not need to go to the Paypal site to cancel the subscription but can easily cancel anytime from the platform itself.

References

[1]. https://en.wikipedia.org/wiki/PayPal

[2]. https://www.paypal.com/us/selfhelp/home - Common Questions