Raisenow’s e-payment web services allow customers to set up recurring payments. To set up a recurring payment these parameters must be defined:
recurring (true|false) recurring_interval (defined as a cron expression) stored_customer_email
Currently only payments by a view payment methods are supported for recurring payments (verify that when recurring is true, the correct payment method is selected - see Supported Payment Methods). The customer’s email address is used to send a confirmation email containing information about the customer’s recurring payment details such as information on how to unsubscribe, the payment interval, or the masked credit card number. Additionally, webhooks can be defined which will be invoked upon certain events that occur in the context of recurring payments. This allows merchants to create customized email notifications and information web pages about the recurring payment status of the customer. When raisenow configures your e-payment account, please inform raisenow if you want to use webhooks. Otherwise, the default raisenow email notifications will be sent. Read more about webhooks in the next chapter. The following list defines which webhook is called on which event.
subscription_subscribed_webhook will be called when a customer has subscribed, namely has set up a recurring payment
subscription_charged_webhook will be called each time a customer is charged
subscription_renewed_webhook will be called each time a customer has renewed the payment method details, such as credit card number
subscription_cancel_webhook Will be called when a customer cancels a recurring payment.
subscription_error_webhook will be called each time an error occurred during the recurring payment execution
To help you better understand recurring payments, an example is given below. Example: Charge monthly at end of month In addition to the mandatory parameters of a non-recurring payment, the following parameters have to be specified, for example by using input fields on a web form.
<input type="checkbox" name="recurring" value="true"/> <input type="input" name="stored_customer_email" value=""/> <input type="radio" name="recurring_interval" value="L * *"/>
The values of the field recurring_interval are based on cron expression parameters, but you only have to specify the day, month, and weekday parameter. Furthermore, raisenow e-payment platform supports an extra value L for specifying the day parameter. This value L means the last day of a month. You can either create your cron expression parameters manually, e.g. via rputils.js (see example in demo/recurrentpayment.html) or if you don’t want to use cron expression parameters at all, there are also a set of keywords, which can be used.
daily; means daily execution (* * *) weekly; means execution on every Monday (* * 1) monthly; means end of month execution (L * *) quarterly; means execution every three months at the end of March, June, September, and December (L */3 *) semestral; means half-yearly execution at the end of June and December (L */6 *) yearly; means once a year on 31st of December
To test your implementation, enter amount, select credit card as payment method (e.g. visa), enter a valid email address, and submit the form. In the background, the e-payment platform checks if the credit card is valid, and if it is possible to charge the specified amount of money. If yes, a subscription will be activated. In the next 10 minutes, you will receive an email from the e-payment platform telling that you have successfully created a recurring payment. If the execution day is set to today (e.g. daily execution), you will also receive an email telling you that your credit card is charged. If you don’t get an email, please inform raisenow technical support team. The chapter “Webhooks and Recurring Payments” explains how to customize the response and to implement a subscription overview page. The example will continue at the end of the chapter.