CIT recurring payments
CIT recurring payments (Customer Initiated Transaction) allow accepting payments and debit money using a 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 token, you can start accepting CIT recurring payments.
Making a CIT recurring payment
To make a CIT recurring payment, complete the following steps:
-
Create a payment session sending a
session/create
request.Alternatively, you can use the
session/init/payment
method. In this case, specify all the payment parameters right away as it is specified in the next step and skip the next step. -
Send a
session/start/payment
request to start the CIT recurring payment. Make sure you send:initiator
:client
in therecurrent
object ofpayment_details
- a URL in the
return_url
parameter of thepayment_options
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: signature' \
--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": "usd"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"return_url": "https://smart-glocal.com"
}
}' -
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. -
Send a
session/confirm
request or asession/cancel
request to confirm or cancel the operation. -
Wait for an
action_required
webhook from Smart Glocal. It will contain aredirect
object.Example
curl -X POST \
https://partner.ru \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"type": "action_required",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z",
"acquiring_payments": [{
"id": "pm_2705",
"status": "pending",
"created_at": "2024-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": "usd"
},
"amounts": {
"fee": {
"merchant_fee": {
"amount": 10,
"currency": "usd"
}
}
},
"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"
}
}
}
}]
}
}' -
Redirect the customer to the URL passed in
customer_interaction.redirect.url
. Note that the redirect method can beGET
orPOST
.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. -
Wait for a
payment_finished
webhook from Smart Glocal. The webhook will contain the recurring payment status information.Example
{
"type": "payment_finished",
"session": {
"id": "ps_3230",
"status": "accepted",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z",
"acquiring_payments": [{
"id": "pm_2705",
"status": "succeeded",
"created_at": "2024-05-27T02:03:00.000000Z",
"finished_at": "2024-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": "usd"
}
}]
}
}