To enable Recurring Payments functionality, first you setup customer approval for the billing agreement, and then create a Checkout.
Please see Create Checkout for more details on using the Get Configuration API to retrieve order limits.
Call the Create Checkout endpoint to tell Clearpay information that includes:
The Checkout request must include this field:
Clearpay responds with a token used to identify this checkout flow.
e.g. 003.5lmerr3k945d00c7htvcrdff83q36kp10a247m212fjpa5ju
This token is used with the Clearpay JavaScript library to direct the customer to the Clearpay checkout flow.
After the customer completes the checkout flow they are returned to the Merchant website URL provided in the Create Checkout request. If using the redirect method the URL has a status appended to the Merchant URL. For Example:
www.merchant-example.com/confirm?&status=SUCCESS&orderToken=003.5lmerr3k945d00c7htvcrdff83q36kp10a247m212fjpa5ju
www.merchant-example.com/confirm?&status=CANCELLED&orderToken=003.5lmerr3k945d00c7htvcrdff83q36kp10a247m212fjpa5ju
A popup method is also available which uses a postMessage
to communicate the status and token.
Now that you have a successful pre-approval for the checkout you can either capture the order directly or create an Auth API call. The Auth API call places funds on hold until you are ready to capture.
Both methods allow you to create the Billing Agreement which was approved by the customer.
This API captures the order and creates the billing agreement, returning to you a paymentid for the checkout order and a billing agreement token. Save this token for future transactions.
This API authorizes the order and creates the billing agreement, returning to you a paymentId for the checkout order and a billing agreement token. Save this token for future transactions.
Next, for the checkout order, you can capture the authorization or do multiple partial captures. See the Deferred Payment Flow for details.
For the Billing Agreement, you can make recurring payments using the saved billing agreement token.
Add and edit Clearpay on-site messaging to your website.