Skip to main content

CIT recurring payments

CIT recurring payments (Customer Initiated Transaction) allow accepting payments and debit money using a recurrent token, i.e. when the customer does not need to re-enter their card details. These payments can be used for paying different services (amounts) at the same place.

To make such payments we carry out an additional 3DS verification of the customer, so make sure you use the project identifier eligible for 3DS.

Once you have a recurrent token, you can start accepting CIT recurrent payments.

Making a CIT recurring payment

To make a CIT recurring payment, complete the following steps:

  1. Create a payment session sending a session/create request.

  2. Send a session/start/payment request to start the CIT recurring payment. Make sure you send:

    • initiator: client in the recurrent object of payment_details
    • a URL in the return_url parameter of the PaymentOptions object to redirect the customer back after the payment complete.
    Example
    curl --location --request POST 'https://demo.smart-glocal.com/api/v1/session/start/payment' \
    --header 'Content-Type: application/json' \
    --header 'X-PARTNER-SIGN: sign' \
    --header 'X-PARTNER-PROJECT: your_project_name' \
    --data-raw '{
    "session_id":"ps_3230",
    "payment_details": {
    "type": "recurrent",
    "recurrent": {
    "token": "token_value",
    "initiator": "client"
    }
    },
    "amount_details": {
    "amount": 10000,
    "currency": "rub"
    },
    "customer": {
    "reference": "lucky"
    },
    "payment_options": {
    "return_url": "https://smart-glocal.com"
    }
    }'
  3. Wait for a ready_to_confirm webhook. When you receive it, it means that Smart Glocal is ready to make the payment and is waiting for your confirmation.

  4. Send a session/confirm request or a session/cancel request to confirm or cancel the operation.

  5. Wait for an action_required webhook from Smart Glocal. It will contain a CustomerInteractionRedirect object.

    Example
    curl -X POST \
    https://partner.ru \
    -H 'Content-Type: application/json' \
    -H 'X-PARTNER-SIGN: a4f1698616d6ad7b8b73a9d72d281eeb443b64dee3f38df430eeed6aa29e1dc' \
    -d '{
    "type": "action_required",
    "session": {
    "id": "ps_3230",
    "status": "in_progress",
    "created_at": "2018-05-27T02:03:00.000000Z",
    "updated_at": "2018-05-27T02:03:00.000000Z",
    "acquiring_payments": [{
    "id": "050",
    "status": "pending",
    "created_at": "2018-05-27T02:03:00.000000Z",
    "customer": {
    "reference":"user@smart-glocal.com"
    },
    "payment_details": {
    "type": "recurrent",
    "recurrent": {
    "token": "token_value",
    "initiator": "client"
    }
    },
    "amount_details": {
    "amount": 10000,
    "currency": "rub"
    },
    "amounts": {
    "fee": {
    "merchant_fee": {
    "amount": 10,
    "currency": "RUB"
    }
    }
    },
    "customer_interaction": {
    "type": "redirect",
    "redirect": {
    "url": "https://smart-glocal.com?foo=bar",
    "base_url": "https://smart-glocal.com",
    "method": "GET",
    "qs": {
    "foo": "bar"
    },
    "params": {
    "PaReq": "sdfew^//asdhbv",
    "MD": "abc75daefnn"
    }
    }
    }
    }]
    }
    }'
  6. Redirect the customer to the URL passed in customer_interaction.redirect.url. Note that the redirect method can be GET or POST.

    Note that after completion of 3DS verification, the customer returns to the URL that was passed as return_url. According to the method used, POST or GET, you might need to convert the POST format to GET to avoid possible format processing issues.

  7. Wait for a payment_finished webhook from Smart Glocal. The webhook will contain the recurring payment status information. To learn about the payment statuses, see here.

    Example
    {
    "type": "payment_finished",
    "session": {
    "id": "ps_3230",
    "status": "accepted",
    "created_at": "2018-05-27T02:03:00.000000Z",
    "updated_at": "2018-05-27T02:03:00.000000Z",
    "acquiring_payments": [{
    "id": "pm_2705",
    "status": "succeeded",
    "created_at": "2018-05-27T02:03:00.000000Z",
    "finished_at": "2018-05-27T02:03:00.000000Z",
    "customer": {
    "reference":"lucky"
    },
    "payment_details": {
    "type": "recurrent",
    "recurrent": {
    "token": "token_value",
    "initiator": "client"
    }
    },
    "recurrent": {
    "token": "feda2b2106a2e8747bbdc4c9f53c7f5f6ab845ffa1b7cc68ca839720af99b3d1",
    "created_at": "2020-07-14T13:17:11+03:00",
    "finished_at": "2020-07-31T16:05:42+03:00",
    "is_active": true
    },
    "amount_details": {
    "amount": 10000,
    "currency": "rub"
    }
    }]
    }
    }

Sequence diagram of CIT recurring payments