Enable recurring payments

Last updated on
28 April 2021

If you want to support prepaid developer access to your API products, you can enable recurring payments on your site. Although you can manage developer access with postpaid accounts, providing an option for recurring payments increases developer self-service and can be used with available payment gateways. For more information on configuring a payment gateways, see Manage payment gateways.

The following steps use the Commerce Recurring Framework module to configure a recurring payment setup with an on-site payment gateway.

Note: This feature is not currently supported for monetized orgs in Apigee X and hybrid.

Prerequisites

  • Before you begin, install and enable the following modules using Composer, if not already installed:
  • Confirm that the Commerce Payment Example module is also enabled. The Commerce Recurring Framework requires an on-site payment gateway to work with recurring payment subscriptions. For the purposes of testing this module, these steps use the "Example (On-site)" payment gateway provided by the Commerce Payment Example module.
  • Confirm that the Apigee Monetization Add Credit module is enabled and that Add Credit products have been configured. For more information on configuring Add Credit, see Steps 2 and 3 of Enable the Apigee Add Credit Module.

Configure payment gateway

To configure the payment gateway required for this framework:

  • Go to Commerce > Configuration > Payment > Payment gateways.
  • Click +Add payment gateway.
  • Fill out the required fields to add a new payment gateway.
    Note: You must select "Example (On-site)" as the Plugin for the payment gateway in order to set up recurring payment framework.
  • Click Save.

Configure billing schedule

To configure the desired billing schedule for recurring payments:

  • Go to Commerce > Configuration > Payment > Billing Schedules.
  • Click +Add billing schedule.
  • Fill out the required fields to configure a Prepaid billing schedule at the desired interval, such as monthly billing.
  • Click Save.

Update product types

To configure a monetization product type that permits prepaid billing:

  • Go to Commerce > Configuration > Products > Product variation types.
  • Select "Edit" from the "Add credit" product variation dropdown.
  • Under Traits, check “Allow subscriptions.”
  • Click Save.

Update products with a billing schedule

To configure the recurring payment billing schedule for each specific "Add Credit" product variation:

  • Go to Commerce > Configuration > Products.
  • Select each "Add Credit" product you wish to use as a recurring payment products.
  • Select the Variations tab and then click +Add variation.
  • Edit the "Add credit" product variation and set the billing schedule for each.
  • Click Save.

View recurring payments

When a user adds credit on a recurring billing schedule, a subscription (or temporary order) is created.

To view all subscriptions, go to Commerce > Subscriptions.

Note: For recurring subscriptions to work correctly with the payment gateway, ensure that your site's Cron is properly configured. For more information on configuration options, see Cron automated tasks.

Help improve this page

Page status: No known problems

You can: