Recurring Payments
This service addresses the needs of merchants offering subscription-based services, allowing them to automate recurring payments on a monthly or yearly basis according to their plans and preferences.
To enable recurring payments, merchants can easily incorporate this feature into their checkout process. By appending is_recurring: true to the Direct Card Checkout request, merchants can swiftly process transactions for subscription services.
However, it's crucial to note that recurring payments will only commence after the customer has completed a Direct Card Checkout at least once. For new merchant customers, it's essential to initiate the Direct Card Checkout API for the initial transaction, setting is_recurring: false. Subsequent transactions can then be processed as recurring payments by specifying is_recurring: true
IMPORTANT
When making a payment for a product or service for the first time, customers must actively choose to save their payment card information by ticking the 'Save Card' checkbox. Failure to do so will result in recurring payments not being processed for that customer.
This requirement ensures that customers explicitly agree to ongoing subscription-based services or products offered by the merchant. It also enhances security by ensuring that customers have full control over their payment preferences. So its crucial that the merchant makes this info known to their customers and create materials to guide them accordingly.
Merchants must exercise diligence in ensuring they only charge customers for the services rendered, maintaining transparency and integrity in their billing practices.
Please be advised that at present, recurring payments are supported exclusively for card payments.
Request URL
{{base_url}}/api/create-order
Requests
Here is the request you are to send to the gateway, the only difference from the Direct Card Payment is the is_recurring flag otherwise check the request type and more from here
{
"code": 102, // 102 for Card Payments
"merchant_order_id": "5",
"amount": 10000,
"currency" : "TZS",
"merchant_cancel_url": "https://www.yoursite.com/cancel",
"merchant_redirect_url": "https://www.yoursite.com/success",
"metadata": {
"anykey": "anyvalue",
"another_anyKey": "another_anyvalue"
},
"billing": {
"address": "Kinondoni Moroco",
"state": "Dar es Salaam",
"city": "Dar es Salaam",
"postcode": "00000",
"country_code": "TZ",
"phone": "255789000111"
},
"merchant_webhook": "https://webhook.site/#!/2250a4d1-a6e2-4ac8-97b2-26dda65da334", // mandatory
"product_count": "1",
"customer_email": "[email protected]",
"customer_name": "Johnny Mnemonic",
"customer_phone": "255789000111",
"is_recurring" : true,
"customer_userid": 2,
"shouldFail" : false
}
Upon initiation of this request by the merchant, the Payment Gateway promptly responds with a success confirmation, without providing a payment URL. It is imperative for the merchant to exercise patience and await the subsequent webhook response from the Gateway. This response will contain pertinent information regarding the transaction status and further instructions, ensuring a seamless and efficient payment process.
Emphasis.
Merchants using this feature must track card payments, they should devise means to note the customers that have made payments with cards and should set up a way to test that they can charge recurring payments without customer intervention. If issues arise with the payment request, merchants will receive immediate notifications via API responses regarding the ability to process recurring payments for the given request.
Or
If the preceding procedure appears cumbersome, merchants have the option to initially attempt recurring payments.
Should this attempt fail, a 430 response status code will be returned immediately, indicating the need to retry the payment without the 'is_recurring' flag or setting the flag tofalsealtogether.Upon initiation of standard card payments, the gateway will furnish the payment URL in response.
Additionally, to streamline future recurring charges for customers, it is recommended to prompt them to securely store their card payment information during their initial checkout using card payments. This can be achieved by encouraging customers to select the "Save Card" checkbox within the payment page.
it goes without saying that if you follow the docs as is and employ your own validation rules before submitting the request to us, you wont have a lot of issues intergrating.
We aim to provide means to help you rectify the mistakes that may be given in the request but use your own discretion too.