Recurring Payment | Embedded Integration
Execute Payments automatically through Card View
Steps
1. Call InitiateSession endpoint
You will call the InitiateSession endpoint and specify that this is a recurring session.
{
"CustomerIdentifier": "TestRecurring-123",
"IsRecurring": true
}
{
"IsSuccess": true,
"Message": "Initiated Successfully!",
"ValidationErrors": null,
"Data": {
"SessionId": "36201229-25ce-4360-9afc-5d901715b3a3",
"CountryCode": "KWT",
"CustomerTokens": []
}
}
Recurring Sessions
Recurring Sessions don't save tokens and it is prohibbited to send the value of SaveToken to be true in a recurring session.
2. Use the SessionId in the Card View
You will use the SessionId to display the Embedded Payment to enable your customer to fill in his card information. For more information about the steps to do this, check the Embedded Payment Section
3. Call ExecutePayment using the SessionId and add the Recurring Model
After the customer fills in his card information and is ready for the next step, you will call ExecutePayment endpoint using the SessionId and add the Recurring Model to the request.
{
"SessionId": "36201229-25ce-4360-9afc-5d901715b3a3",
"invoiceValue": 20,
"RecurringModel": {
"RecurringType": "Daily",
"IntervalDays": null,
"Iteration": 1,
"RetryCount": 5
}
}
{
"IsSuccess": true,
"Message": "Invoice Created Successfully!",
"ValidationErrors": null,
"Data": {
"InvoiceId": 4283109,
"IsDirectPayment": false,
"PaymentURL": "https://demo.MyFatoorah.com/En/KWT/PayInvoice/MpgsAuthentication?paymentId=07074283109216281472&sessionId=SESSION0002341682400N21310362I5",
"CustomerReference": null,
"UserDefinedField": null,
"RecurringId": "RECUR121809319"
}
}
4. Redirect the customer to the PaymentUrl
You will redirect the customer to the PaymentUrl to enter his OTP. After that, the customer is redirected to your CallBackUrl/ErrorUrl that you sent in ExecutePayment request.
Updated about 2 months ago