Direct Charge Integration

Cleeng-Managed recurring billing can be integrated as a one-step process: Payment Capture only. This tutorial describes this process.

Description

Cleeng Webhooks send notifications for the events that happen within the Cleeng system, one of these events is subscriptionReadyForPaymentCapture.

Once subscribed to this event, you will be receiving all the data necessary for performing payment capture processes to the specified endpoint that was set up during Webhooks configuration. The payment capture action needs to be performed with the payment gateway.

Afterward, the result of the payment capture will be either failure or success. In both cases, a call must be made to Cleeng Payment API to either capture or reject the payment with the rejection reason on the Cleeng platform side.

Payment capture can happen after the authorisation process or it can appear alone.

If recurring billing consists of capture only (there is no authorisation step), the payment capture process looks as follows:

Process Flow

Payment Capture Process Flow - Without AuthorisationPayment Capture Process Flow - Without Authorisation

Payment Capture Process Flow - Without Authorisation

📘

Note

Details of the implementation will depend on a specific payment gateway solution.

Step-by-Step Guide

  • Prerequisites
    Before you start, you need to subscribe to the event that you would like to be notified about, in our case this is subscriptionReadyForPaymentCapture (refer here for the guide).

    Upon subscribing to this event, you will be receiving all the data necessary for performing the capture process to the specified endpoint that was set up during Webhooks configuration.

  • Step 1: Create order
    Create order based on webhook subscriptionReadyForPaymentCapture using POST /3.1 /orders.

  • Step 2: Capture Payment
    This step depends on the remote payment gateway system. In general, a request should be made to the remote payment gateway to trigger payment capture for the specific subscriber (subscription data is sent in the event).

  • Step 3: Capture Payment Result
    One of two scenarios will apply depending on the result of the payment capture that was triggered in the previous step.

    - SUCCESS: CREATE CAPTURED PAYMENT
    To notify the Cleeng platform that the payment capture was successful. an API call should be made to Cleeng Payment API using payments method.

    The Connector should create payment in Cleeng using POST/3.1 /payments with ‘captured’ status.

    - FAILURE: CREATE REJECTED PAYMENT
    To notify the Cleeng platform that the payment failed, an API call should be made to Cleeng Payment API using payments method.

    The Connector should create payment in Cleeng using POST/3.1 /payments with 'rejected' status.

Up Next

Well done! Now that you are ready with recurring billing you can move on to other features:


Did this page help you?