Авторизация
Транзакция используется для проверки банковской карты и резервирования суммы платежа на карт-счете покупателя. Реального списания средств с карты не происходит, но баланс карты показывается за вычетом суммы авторизации.
Далее используйте следующие транзакции: списание средств или отмена авторизации.
Info
Требуется наличие PCI DSS сертификата, чтобы использовать данную транзакцию и обрабатывать не шифрованные данные карты.
Запрос
Для проведения авторизации отправьте POST
запрос на https://gateway.unonapay.com/transactions/authorizations
со следующими параметрами:
Note
Тело запроса должно быть обёрнуто в корневой объект request{}.
|
Пример запроса
{
"request":{
"amount":100,
"currency":"USD",
"description":"Test transaction",
"tracking_id":"your_uniq_number",
"language":"en",
"test":true,
"billing_address":{
"first_name":"John",
"last_name":"Doe",
"country":"US",
"city":"Denver",
"state":"CO",
"zip":"96002",
"address":"1st Street"
},
"credit_card":{
"number":"4200000000000000",
"verification_value":"123",
"holder":"John Doe",
"exp_month":"05",
"exp_year":"2027"
},
"customer":{
"ip":"127.0.0.1",
"email":"john@example.com"
}
}
}
Пример запроса с токеном карты
{
"request":{
"amount":100,
"currency":"USD",
"description":"Test transaction",
"tracking_id":"your_uniq_number",
"test":true,
"billing_address":{
"first_name":"John",
"last_name":"Doe",
"country":"US",
"city":"Denver",
"state":"CO",
"zip":"96002",
"address":"1st Street"
},
"credit_card":{
"token":"40bd001563085fc35165329ea1ff5c5ecbdbbeef40bd001563085fc35165329e"
},
"customer":{
"ip":"127.0.0.1",
"email":"john@example.com"
}
}
}
Пример запроса с информацией о продаже авиабилетов и тур путевок
{
"request":{
"amount":100,
"currency":"USD",
"description":"Test transaction",
"tracking_id":"your_uniq_number",
"test":true,
"billing_address":{
"first_name":"John",
"last_name":"Doe",
"country":"US",
"city":"Denver",
"state":"CO",
"zip":"96002",
"address":"1st Street"
},
"credit_card":{
"token":"40bd001563085fc35165329ea1ff5c5ecbdbbeef40bd001563085fc35165329e"
},
"customer":{
"ip":"127.0.0.1",
"email":"john@example.com"
},
"travel": {
"airline": {
"agency_code": "03",
"agency_name": "Corel travel",
"ticket_number": "390 5241 025377 1",
"booking_number": "DKZVUA",
"restricted_ticked_indicator": "0",
"legs": [
{
"airline_code": "B2",
"stop_over_code": "X",
"flight_number": "A3 971",
"departure_date_time": "2014-05-26T05:15:00",
"arrival_date_time": "2014-05-26T07:30:00",
"originating_country": "RU",
"originating_city": "Moscow",
"originating_airport_code": "DME",
"destination_country": "Greece",
"destination_city": "Athems",
"destination_airport_code": "ATH",
"coupon": "coupon code",
"class": "C"
}
],
"passengers":[
{
"first_name": "KONSTANTIN",
"last_name": "IVANOV"
},
{
"first_name": "JULIA",
"last_name": "IVANOVA"
}
]
}
}
}
}
Пример запроса с дополнительным текстом
{
"request":{
"amount":100,
"currency":"USD",
"description":"Test transaction",
"tracking_id":"your_uniq_number",
"language":"en",
"test":true,
"billing_address":{
"first_name":"John",
"last_name":"Doe",
"country":"US",
"city":"Denver",
"state":"CO",
"zip":"96002",
"address":"1st Street"
},
"credit_card":{
"number":"4200000000000000",
"verification_value":"123",
"holder":"John Doe",
"exp_month":"05",
"exp_year":"2027"
},
"additional_data":{
"receipt_text": ["First line", "Second Line"]
},
"customer":{
"ip":"127.0.0.1",
"email":"john@example.com"
}
}
}
Ответ
Ответ будет содержать те же параметры, что и запрос, а также дополнительные параметры:
|
|
Пример ответа
{
"transaction": {
"uid": "bf2ebe5b-0a31-4769-b61d-a46afa3b98fa",
"status": "successful",
"amount": 482,
"currency": "EUR",
"description": "Test transaction",
"type": "authorization",
"payment_method_type": "credit_card",
"tracking_id": "your_uniq_number",
"message": "Successfully processed",
"test": true,
"created_at": "2024-04-02T08:40:33.377Z",
"updated_at": "2024-04-02T08:40:38.455Z",
"paid_at": "2024-04-02T08:40:38.400Z",
"expired_at": null,
"recurring_type": "initial",
"closed_at": null,
"settled_at": null,
"manually_corrected_at": null,
"language": "en",
"credit_card": {
"holder": "John Doe",
"stamp": "bb58cad9c1204ca2287b3e1006cc1a2c0fb8f062dde9e5232c8be5498bd0e62a",
"brand": "visa",
"last_4": "1097",
"first_1": "4",
"bin": "401200",
"bin_8": "40120000",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": 7,
"exp_year": 2027,
"token_provider": null,
"token": "854d95e6-b7a5-41fb-b2a0-b8a6a0ae2021"
},
"receipt_url": "https://online.unonapay.com/customer/transactions/bf2ebe5b-0a31-4769-b61d-a46afa3b98fa/e6d23017fb43c6e2be34992efef50cfbadd3bb64942d7a9fe74a3e726a3907a6?language=en",
"status_code": null,
"gateway": {
"iframe": false
},
"mute_notifications": null,
"id": "bf2ebe5b-0a31-4769-b61d-a46afa3b98fa",
"additional_data": {
"contract": [
"recurring"
]
},
"redirect_url": "https://gateway.unonapay.com/process/bf2ebe5b-0a31-4769-b61d-a46afa3b98fa",
"code": "S.0000",
"friendly_message": "The operation is successful.",
"smart_routing_verification": {
"status": "successful"
},
"authorization": {
"auth_code": "654321",
"bank_code": "05",
"rrn": "999",
"ref_id": "777888",
"message": "Authorization was approved",
"amount": 482,
"currency": "EUR",
"billing_descriptor": "test descriptor",
"gateway_id": 3208,
"status": "successful"
},
"customer": {
"ip": null,
"email": null,
"device_id": null,
"birth_date": null
},
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"address": "1st Street",
"country": "US",
"city": "Denver",
"zip": "96002",
"state": "CO",
"phone": null
}
}
}
Пример ответа в случае, если требуется 3-D Secure проверка
{
"transaction": {
"uid": "1f63b7ec-c58f-4a38-87bc-e8ea55a7d9c5",
"status": "incomplete",
"amount": 482,
"currency": "EUR",
"description": "Test transaction",
"type": "authorization",
"payment_method_type": "credit_card",
"tracking_id": "your_uniq_number",
"message": null,
"test": true,
"created_at": "2024-04-02T10:22:01.352Z",
"updated_at": "2024-04-02T10:22:03.058Z",
"paid_at": null,
"expired_at": null,
"recurring_type": "initial",
"closed_at": null,
"settled_at": null,
"manually_corrected_at": null,
"language": "en",
"credit_card": {
"holder": "John Doe",
"stamp": "bb58cad9c1204ca2287b3e1006cc1a2c0fb8f062dde9e5232c8be5498bd0e62a",
"brand": "visa",
"last_4": "1097",
"first_1": "4",
"bin": "401200",
"bin_8": "40120000",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": 7,
"exp_year": 2027,
"token_provider": null,
"token": "5d1392f2-864d-499b-b3ce-40e68d980d71"
},
"receipt_url": "https://online.unonapay.com/customer/transactions/1f63b7ec-c58f-4a38-87bc-e8ea55a7d9c5/4bfe945ab88e76507becb0f792f14426ad261afe2f809932cdcfd6c713ad6339?language=en",
"status_code": null,
"gateway": {
"iframe": true
},
"mute_notifications": null,
"id": "1f63b7ec-c58f-4a38-87bc-e8ea55a7d9c5",
"additional_data": {
"contract": [
"recurring"
]
},
"redirect_url": "https://gateway.unonapay.com/process/1f63b7ec-c58f-4a38-87bc-e8ea55a7d9c5",
"code": "P.4012",
"friendly_message": "Redirect to pass 3-D Secure verification.",
"smart_routing_verification": {
"status": "successful"
},
"three_d_secure_verification": {
"status": "incomplete",
"message": "Authentication Available",
"ve_status": "Y",
"acs_url": null,
"pa_req": null,
"md": null,
"pa_res_url": "https://online.unonapay.com/process/1f63b7ec-c58f-4a38-87bc-e8ea55a7d9c5",
"eci": null,
"pa_status": null,
"xid": null,
"cavv": null,
"cavv_algorithm": null,
"fail_reason": null,
"method_process_url": null,
"creq": null
},
"authorization": {
"auth_code": null,
"bank_code": null,
"rrn": null,
"ref_id": null,
"message": null,
"amount": 482,
"currency": "EUR",
"billing_descriptor": null,
"gateway_id": 3483,
"status": "incomplete"
},
"customer": {
"ip": null,
"email": null,
"device_id": null,
"birth_date": null
},
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"address": "1st Street",
"country": "US",
"city": "Denver",
"zip": "96002",
"state": "CO",
"phone": null
}
}
}