Перейти до основного вмісту

API інтеграція

Цей тип інтеграції дозволяє проводити вторинні операції із зарахування всієї суми резерву або його частини.

Формат взаємодії:

Формат взаємодії

Зарахування всієї суми резерву

Особливості використання цієї інтеграції для зарахування повної суми резерву:

  1. Запит до Financial Line API на зарахування резерву може застосовуватися тільки до первинних операцій резервування (auth) з успішним статусом (success).
  2. Використовуйте HTTP-метод POST.

Параметри запиту:

ParameterTypeRequiredDescription
pos_idUUIDMerchant's identifier (POS_ID)
order_idStringMerchant's order identifier to be captured (max length is 32 characters)
order_currencyCURRENCYCurrency of original order
commentStringCapture comment. Can be used for describing reasons of capture or for passing another data about operation (max length is 2048 characters)
server_urlURLWebhook notification will be sent to this URL

Приклад запиту:

$ curl "https://api.finline.io/api/v1/capture" \
-H "Content-Type: application/json" \
-H "X-API-AUTH: CPAY ${API_KEY}:${API_SECRET}" \
-H "X-API-KEY: ${ENDPOINTS_KEY}" \
-X POST -d '{
"pos_id": "${POS_ID}",
"order_id": "123",
"order_currency": "UAH",
"comment": "10101",
"server_url": "https://callback.blackhole.com/callback/capture"
}'

Параметри відповіді:

ParameterTypeDescription
operation_idUUIDUnique Financial Line capture identifier
payment_idUUIDFinancial Line payment identifier of primary operation
order_idStringMerchant's order_id of primary operation (max length is 32 characters)
transaction_idUUIDUnique Financial Line transaction identifier
pos_idUUIDMerchant's identifier (POS_ID)
modeMODEdirect
methodMETHODcapture
amountNumberActual captured amount
order_currencyCURRENCYTransaction currency
statusSTATUSTransaction status
status_codeSTATUS_CODEFinancial Line payment status code
status_descriptionSTATUS_DESCRIPTIONFinancial Line payment status code description
created_atTIMESTAMPTimestamp when transaction was created
processing_timeTIMESTAMPTimestamp when transaction was updated last time
feeObjectAmount and currency of commission
commentStringCapture comment

Приклад відповіді:

{
"operation_id": "f7d0c7cb-af32-441f-b2af-4d90d4da70e1",
"payment_id": "fdf1a710-8a34-414c-b023-b7e78104301a",
"order_id": "123",
"transaction_id": "4f98dc46-ffff-4ba7-a267-286fe7669894",
"pos_id": "dc728de1-51ef-4ef1-80f7-3b44b07b5667",
"mode": "direct",
"method": "capture",
"amount": 100,
"order_currency": "UAH",
"status": "success",
"status_code": "1000",
"status_description": "Transaction is successful.",
"created_at": "2018-10-10T10:10:10.100",
"processing_time": "2018-10-10T10:10:12.000",
"fee": null,
"comment": "10101"
}

Зарахування частини суми резерву

Формат взаємодії:

Формат взаємодії Зарахування частини суми резерву

У випадку зарахування не всієї суми резерву, а лише його частини у запиті додатково також має передаватися обов’язковий параметр: charge_amount Number

Параметри запиту:

ParameterTypeRequiredDescription
pos_idUUIDMerchant's identifier (POS_ID)
order_idStringMerchant's order identifier to be captured (max length is 32 characters)
order_currencyCURRENCYCurrency of original order
charge_amountNumberAmount to be captured
commentStringCapture comment. Can be used for describing reasons of capture or for passing another data about operation (max length is 2048 characters)
server_urlURLWebhook notification will be sent to this URL

Приклад запиту:

$ curl "https://api.finline.io/api/v1/capture" \
-H "Content-Type: application/json" \
-H "X-API-AUTH: CPAY ${API_KEY}:${API_SECRET}" \
-H "X-API-KEY: ${ENDPOINTS_KEY}" \
-X POST -d '{
"pos_id": "${POS_ID}",
"order_id": "123",
"order_currency": "UAH",
"charge_amount": 80,
"comment": "10101",
"server_url": "https://callback.blackhole.com/callback/capture"
}'

Параметри відповіді:

ParameterTypeDescription
operation_idUUIDUnique Financial Line capture identifier
payment_idUUIDFinancial Line payment identifier of primary operation
order_idStringMerchant's order_id of primary operation (max length is 32 characters)
transaction_idUUIDUnique Financial Line transaction identifier
pos_idUUIDMerchant's identifier (POS_ID)
modeMODEdirect
methodMETHODcapture
amountNumberActual captured amount
currencyCURRENCYTransaction currency
statusSTATUSTransaction status
status_codeSTATUS_CODEFinancial Line payment status code
status_descriptionSTATUS_DESCRIPTIONFinancial Line payment status code description
created_atTIMESTAMPTimestamp when transaction was created
processing_timeTIMESTAMPTimestamp when transaction was updated last time
feeObjectAmount and currency of commission
commentStringCapture comment

Приклад відповіді:

{
"operation_id": "f7d0c7cb-af32-441f-b2af-4d90d4da70e1",
"payment_id": "fdf1a710-8a34-414c-b023-b7e78104301a",
"order_id": "123",
"transaction_id": "4f98dc46-ffff-4ba7-a267-286fe7669894",
"pos_id": "dc728de1-51ef-4ef1-80f7-3b44b07b5667",
"mode": "direct",
"method": "capture",
"amount": 100,
"currency": "UAH",
"status": "success",
"status_code": "1000",
"status_description": "Transaction is successful.",
"created_at": "2018-10-10T10:10:10.100",
"processing_time": "2018-10-10T10:10:12.000",
"fee": null,
"comment": "10101"
}

Зарахування понад суму резерву

Формат взаємодії (залежно від інтеграції):

Варіант 1:

Варіант 1

Варіант 2:

Варіант 2

При використанні функціоналу зарахування понад суму резерву, при ініціації транзакції зарахування резерву в параметрі charge_amount слід передати суму, що має бути зараховано.

Важливо

Вказана сума не може перевищувати відсоток, встановлений у налаштуваннях вашого проєкту на стороні Financial Line.

Наступні кроки

Тестування платіжного процесу:

Вихід в онлайн

Коли наша команда Комплаєнсу активує робочий проєкт, замініть автентифікаційні дані тестового проєкту на дані робочого.

Дивіться також: