OpenCart recurring payments tutorial

To set up OpenCart recurring payment you need to create OpenCart recurring profile and corresponding Stripe profile. Then you need to map OpenCart recurring profile to each product you need to have recurring payment.


To recurring payments functionality work properly you need set up webhook endpoint at Stripe Dashboard so that it points to the extension webhook page.


OpenCart recurring profile creation.


Go to "Catalog > Recurring Profiles" and click "Add new" button to create new or "Copy" button to copy existing recurring profile.

At profile page set profile "Name", under which it will be presented to a customer. Set "Price" for each recurring cycle, "Frequency" of recurring payments (eg day, week) and "Cycle" of each recurring period. Cycle means how many elementary frequency periods contains one recurring period. For example, if you set a frequency for "semi month" and cycle to 2, then the recurring period will last for a month.

If you want that recurring payments has a certain number of repetitions, set "Duration" to that repetitions number. If you set "Duration" to 0 - then recurring payment will last until will be manually canceled.

If you wish to propose a trial period for your customers, configure "Trial profile" part of the recurring profile in the same way as "Recurring profile" part. The only difference is that "Trial duration" can be only "1" (if set to zero trial period will be discarded, if set to a value, greater then 1, payment method will be unavailable).


Stripe profile creation


To set up Stripe Profile go to Stripe Dashboard and at "Plan" tab click at "New" button to create a new plan. In the pop-up window set a unique identifier (without white spaces), plan name, which will be presented to users. Currency set to Stripe Dashboard currency since Stripe payment gateway uses that currency for all recurring payments. Set amount to OpenCart recurring price (ex-tax). Stripe "Interval" setting stands for a combination of "Frequency" and "Cycle" OpenCart's settings. Stripe has no "semi month" frequency. To emulate it set "Interval" at "2 weeks". Stripe has no recurring payment end setting, so OpenCart "Duration" setting will be used for this purpose. Stripe trial period expressed in days so you need to convert OpenCart plans' recurring duration in days and fill in this option (if the trial period is present). Optionally fill in "Statement descriptor" which will appear at customers' invoice (no more than 22 characters).


Applying a recurring plan to a product


To map product to specific recurring plan go to "Catalog > Products". Select product under "Recurring" tab and add a desired recurring plan.

Stripe payment gateway permits only one recurring profile per product.


With stripe payment gateway all these steps are not mandatory. For example, you may configure only OpenCart recurring profile and extension will create corresponding Stripe plan during checkout. Or you may export existing Stripe plane to OpenCart. In this case, you need set "Duration" and "Trial price" (if any) options since Stripe has some limitation in this regard.


Stripe payment gateway recurring settings


You can manage Stripe profiles right thru Stripe payment gateway Admin area's "Recurring plans" tab (fig. 1).

Figure 1. Recurring plans tab


Under "Stripe plan" column listed all existing Stripe plans. Under "OpenCart recurring profile" column set corresponding OpenCart recurring profile. Under "Statement Descriptor" column set statement descriptor for the corresponding plan.

Using "Recurring plans" tab's tools you can:

  • export Stripe plan to OpenCart. To do it click on "Left chevron" button. After exporting you need to set duration option on newly created OpenCart recurring plan since all exported plans are endless. If "Chevron left" button has a gray color, then the plan cannot be exported (it already exists in OpenCart or has a currency other than default store currency)
  • delete Stripe plan. To do it click "Delete" button for the corresponding Stripe plan;
  • rename Stripe plan and change plans' statement descriptor. To do it change current value and click on "Pencil" button.
  • map Stripe plan to OpenCart recurring profile. Mapping needed to prevent Stripe plans duplication (if during checkout, the extension will not detect corresponding (mapped) Stripe plan - then it will create a new plan for Stripe Dashboard). To map plan start typing plan name in "OpenCart Recurring Profile" column input opposite corresponding "Stripe Plan" input. Then in drop-down list pick OpenCart recurring profile. To undo profile mapping click on "Unlock" button at the corresponding "OpenCart Recurring Profile" input.


Stripe payment gateway profiles


To give as much flexibility to recurring payments as possible Stripe Payment Gateway presents customizable profiles, which may be assigned to OpenCart recurring profiles. To manage these profiles go to "Recurring Plans' profiles" tab. (fig. 2, 3).


Figure 2. Recurring profile. Non-recurring item options



Figure 3. Recurring profile. Default settings.


By default, there are two profiles: "NonRecurring" - applied to non-recurring items in order - and "Default" - applied to all recurring items in order.

"NonRecurring" profile has the option "Include to non-recurring payment". This setting tells to the extension which invoice lines should be present at non-recurring part of a charge.

"Default" profile has "Name" setting (can be changed for custom plans), "Include to recurring payment" - which totals lines should be placed at a recurring charge , "Add to one-time payment" - which totals lines should be placed at one-time charge (payment which made once during checkout). Additionally it has "Can be canceled by customer" setting with defines whether subscription can be canceled by customer via its account, "Can be canceled immediately" - whether subscription can be canceled immediately, "Consider product options" - whether recurring price should be affected by products' options (eg different color, size in case if it affect product price). This will affect each recurring payment on full option amount. Option "Make ordinary order" instruct extension to create additionally ordinary order for the recurring product along with recurring one.

You may create as many profiles, based on "Default", as you need and map them to OpenCart recurring profiles at "Profiles Mapping" tab (fig. 4).

Figure 4. Mapping OpenCart recurring profiles to stripe payment gateway profiles.