Методы P2P создают операцию и возвращают в ответе номер платежного средства для осуществления перевода денег клиентом. В некоторых случаях для получения платежного средства клиенту понадобится пройти дополнительную проверку. После совершения перевода денег будет отправлен стандартный callback.
В случае успешного завершения операции в ответ придет статус WAITING_FOR_EXTERNAL_AUTH
с номером и типом платежного средства. При необходимости дополнительной проверки придет ответ WAITING_FOR_CONFIRMATION
с параметрами для верификации. На данный момент поддерживается только тип CAPTCHA_ROTATIONS
с 9 картинками (матрица 3x3), в формате base64
.
Завершение P2P
Для завершения проверки клиента и получения номера платежного средства необходимо отправить запрос с количеством вращений каждой картинки.
Поддерживаемые платежные средства
-
банковская карта
-
номер телефона
-
номер счета
-
внешняя страница провайдера
Поддерживаемые методы проверки
-
rotation captcha
Тестовый банк
Моделирование различных сценариев возможно с помощью передачи различных номеров телефона плательщика во входящих параметрах.
payer.phone | результат |
---|---|
1111111111 |
перевод по номеру телефона |
2222222222 |
перевод на внешней странице |
3333333333 |
перевод по номеру карты |
1111111199 |
перевод по номеру телефона с предварительной верификацией |
2222222299 |
перевод на внешней странице с предварительной верификацией |
3333333399 |
перевод по номеру карты с предварительной верификацией |
прочие |
отказ |
Для успешного прохождения верификации необходимо передать 9 единиц в поле rotations.
Примеры запросов и ответов
Банковская карта
POST /card/1-1/operations/p2p HTTP/1.1
W1-Signature: yn6PwmVJjTNkyW19YWBvbxYunHXAPn27B/QEUtI0vYK+HkuW2KiZjA3C0cWUYInJK0n+iQST9ghzDWt+UBNnuqIrs3dK05AydfeDA2pbkOTiCyZcxQ35Sl5Tc0nadbti7qF/Lvj6WXF4MuO9LxUD6GEawMvQQggVbCf0/uLyUMZIQeDALHBHMn6iocCEbdzZ3uiv7iDHA+JgrfVi6Nds3668BuqeGKrVyZdiNopT1gW3dDGyJhDeyHNpkhRq8Hj7apynx5cXZc6j8EAcVdm0g9Laj6Jpqwi1fA0uCwAQl+QEpJcpGyYJGsiXnC7kNpcn0M16pUjiQPJuaALwMSn+5w==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 506
{
"notification" : {
"url" : "http://127.0.0.1:8080/test/callback/default/",
"version" : 1
},
"externalId" : "ext#75",
"amount" : {
"amount" : 10.55,
"currency" : "USD"
},
"payer" : {
"paymentMethod" : null,
"info" : {
"ip" : "127.0.0.1",
"phone" : "3333330000",
"email" : "name@example.com"
}
},
"merchantParameters" : {
"param1" : "anything you want for callback",
"param2" : null,
"param3" : null
},
"pageParameters" : null
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 348
{
"operationId" : "1-1-a-63",
"status" : "WAITING_FOR_EXTERNAL_AUTH",
"type" : "P2P",
"externalId" : "ext#75",
"params" : { },
"actions" : {
"required" : [ ]
},
"externalPaymentParameters" : {
"card" : {
"pan" : "4000000000000002",
"bank" : {
"name" : "BBANK"
},
"receiver" : null
}
}
}
Банковский счет
POST /card/1-1/operations/p2p HTTP/1.1
W1-Signature: mBtHqq3rejX44bPu6qnaR63WijR1OrmsLgDQWp0fqtqexlduWZB5E4evUnLCAbXA7554XWMBJmoKHN5E0wMraewDuQ/CgCh0KOWd9BJv93SaC27fj/PkGctGm0IcClig27+MhU+wr85qOyews/H2/MJ1HjKbHr+Q6zHXKOJkU8m8pIlpWatmTZzGwU0L/3V1uYLlzxh3J7UyGsySydv6rS7NXvXEP5dQ9RiRvtfvaFxih4G2dQcLaVZxUgRBeap9DXLz5mGyOdmt2mEIlDql6MrR9tOb35vsz/1qUUkLIu1XYjiF71LbbUUItVR3E+v9DyKWcmB402Afdb8OM/lcxw==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 506
{
"notification" : {
"url" : "http://127.0.0.1:8080/test/callback/default/",
"version" : 1
},
"externalId" : "ext#82",
"amount" : {
"amount" : 10.55,
"currency" : "USD"
},
"payer" : {
"paymentMethod" : null,
"info" : {
"ip" : "127.0.0.1",
"phone" : "4444440000",
"email" : "name@example.com"
}
},
"merchantParameters" : {
"param1" : "anything you want for callback",
"param2" : null,
"param3" : null
},
"pageParameters" : null
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 358
{
"operationId" : "1-1-a-69",
"status" : "WAITING_FOR_EXTERNAL_AUTH",
"type" : "P2P",
"externalId" : "ext#82",
"params" : { },
"actions" : {
"required" : [ ]
},
"externalPaymentParameters" : {
"account" : {
"number" : "20000000000000000004",
"bank" : {
"name" : "CBANK"
},
"receiver" : null
}
}
}
Номер телефона
POST /card/1-1/operations/p2p HTTP/1.1
W1-Signature: yEz/UUc4bzp2pZCacevwZagc2xpM3vCrheH9t9YOtQ29hheMyNy9V10vyh0WgjnFEGSXSEL+UeygUgq0dpFA9qXgqM9kaw1u8clIGtBMAkaWq0/lyAE+4MUNgk341/ht/x9U0x0dhz6UBBMp8FWiAFaccUXzFuqdf+BXTSRT0L1TWibyhh03mcohO0VUKZYt46h49QbgC0kIbnBCI2o0Kuh4l5X/x8L6TT7Y7qkZ7C8XgYNuJ2K5rzirbSghwuMDaZ/ykmYtY/efnmreccHBUC+TbwoajK+nfr744trdy26XUbJIfbwjG3Ty/EA7GmJ9yLmM6ZEoy0Ps95r6PNAc1A==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 506
{
"notification" : {
"url" : "http://127.0.0.1:8080/test/callback/default/",
"version" : 1
},
"externalId" : "ext#76",
"amount" : {
"amount" : 10.55,
"currency" : "USD"
},
"payer" : {
"paymentMethod" : null,
"info" : {
"ip" : "127.0.0.1",
"phone" : "1111110000",
"email" : "name@example.com"
}
},
"merchantParameters" : {
"param1" : "anything you want for callback",
"param2" : null,
"param3" : null
},
"pageParameters" : null
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 374
{
"operationId" : "1-1-a-64",
"status" : "WAITING_FOR_EXTERNAL_AUTH",
"type" : "P2P",
"externalId" : "ext#76",
"params" : { },
"actions" : {
"required" : [ ]
},
"externalPaymentParameters" : {
"phone" : {
"number" : "1231231",
"bank" : {
"name" : "ABANK"
},
"receiver" : {
"name" : "IVAN I"
}
}
}
}
Внешняя платежная страница
POST /card/1-1/operations/p2p HTTP/1.1
W1-Signature: mBtHqq3rejX44bPu6qnaR63WijR1OrmsLgDQWp0fqtqexlduWZB5E4evUnLCAbXA7554XWMBJmoKHN5E0wMraewDuQ/CgCh0KOWd9BJv93SaC27fj/PkGctGm0IcClig27+MhU+wr85qOyews/H2/MJ1HjKbHr+Q6zHXKOJkU8m8pIlpWatmTZzGwU0L/3V1uYLlzxh3J7UyGsySydv6rS7NXvXEP5dQ9RiRvtfvaFxih4G2dQcLaVZxUgRBeap9DXLz5mGyOdmt2mEIlDql6MrR9tOb35vsz/1qUUkLIu1XYjiF71LbbUUItVR3E+v9DyKWcmB402Afdb8OM/lcxw==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 506
{
"notification" : {
"url" : "http://127.0.0.1:8080/test/callback/default/",
"version" : 1
},
"externalId" : "ext#82",
"amount" : {
"amount" : 10.55,
"currency" : "USD"
},
"payer" : {
"paymentMethod" : null,
"info" : {
"ip" : "127.0.0.1",
"phone" : "4444440000",
"email" : "name@example.com"
}
},
"merchantParameters" : {
"param1" : "anything you want for callback",
"param2" : null,
"param3" : null
},
"pageParameters" : null
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 358
{
"operationId" : "1-1-a-69",
"status" : "WAITING_FOR_EXTERNAL_AUTH",
"type" : "P2P",
"externalId" : "ext#82",
"params" : { },
"actions" : {
"required" : [ ]
},
"externalPaymentParameters" : {
"account" : {
"number" : "20000000000000000004",
"bank" : {
"name" : "CBANK"
},
"receiver" : null
}
}
}
Проверка Captcha
POST /card/1-1/operations/p2p HTTP/1.1
W1-Signature: SPR5xioPrNH7xBAPEDNkMLENA+W+ILNiQWfzQyy+ukykrJvqbgfFU6SN4FVHWbr130cts6T0FyjAMaWX/Xi1ftQdxfymT75LuqbXaJZSIapCN26PLk09rGZsgNNSZw2P52VpZIvLBmOYF+lZvftHKA2DlXs3UkmlhGSEpDCmSf099m55OhIEhjY4BvAz6t0ElpjcQdNwrOOHVb3iwN3gfaPelr/3xlMZ6SKEk4w8iFggPNDdzbzkhiurEPaSYL0bX+AJ5jY1wahs/T+BeDOqvRv0lWfuZznWf0vqIl0+b1YibgKZMkuujRZhLNpW+gNXYPZ/pkirvEV+UcS8j3t5og==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 506
{
"notification" : {
"url" : "http://127.0.0.1:8080/test/callback/default/",
"version" : 1
},
"externalId" : "ext#77",
"amount" : {
"amount" : 10.55,
"currency" : "USD"
},
"payer" : {
"paymentMethod" : null,
"info" : {
"ip" : "127.0.0.1",
"phone" : "3333331000",
"email" : "name@example.com"
}
},
"merchantParameters" : {
"param1" : "anything you want for callback",
"param2" : null,
"param3" : null
},
"pageParameters" : null
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 336
{
"operationId" : "1-1-a-65",
"status" : "WAITING_FOR_CONFIRMATION",
"type" : "P2P",
"externalId" : "ext#77",
"params" : { },
"actions" : {
"required" : [ ]
},
"verificationParameters" : {
"type" : "CAPTCHA_ROTATIONS",
"params" : {
"images" : [ "a", "b", "c", "d", "e", "f", "g", "h", "i" ]
}
}
}
POST /card/1-1/operations/1-1-a-65/completep2p HTTP/1.1
W1-Signature: zyzr4/m/VB5wYUN/2EsKX0vAmvZQqvsPD+P5rqOhUgewaSd8bRPLCQFuHw6lzAqqZOFR+nvQtM9cpuD3raeb8Qgvxgp0fDTzw87NyLFQ9QN7/37TLxpmmnY/kSKz/lJmGBw8B07EPB63nhdWdVT6mc/Cn2b+tFF2RRil6PifGZVnwEUxu+msoZPedYYqAE5S8l+DCa3HmRRBHyMBMC2AAtu+ZFWVoYDKvbWNn7GAZsimZYVvNpFF33ovH3aY1Y93AiKcsK0zhp1HcEGWnLe9zG2YRPSGh6MA7mPFtpbLT3OJSpZn6H1NH5p9i67zZi8Me6pQmyHY8E1gBTUxQxyADw==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 102
{
"type" : "CAPTCHA_ROTATIONS",
"entity" : {
"rotations" : [ 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
}
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 348
{
"operationId" : "1-1-a-65",
"status" : "WAITING_FOR_EXTERNAL_AUTH",
"type" : "P2P",
"externalId" : "ext#77",
"params" : { },
"actions" : {
"required" : [ ]
},
"externalPaymentParameters" : {
"card" : {
"pan" : "4000000000000002",
"bank" : {
"name" : "BBANK"
},
"receiver" : null
}
}
}
Пример кода для отображения Captcha
<table>
<tr>
<td><img src="data:image/png;base64, ${images[0]}" id="img0"/></td>
<td><img src="data:image/png;base64, ${images[1]}" id="img1"/></td>
<td><img src="data:image/png;base64, ${images[2]}" id="img2"/></td>
</tr>
<tr>
<td><img src="data:image/png;base64, ${images[3]}" id="img3"/></td>
<td><img src="data:image/png;base64, ${images[4]}" id="img4"/></td>
<td><img src="data:image/png;base64, ${images[5]}" id="img5"/></td>
</tr>
<tr>
<td><img src="data:image/png;base64, ${images[6]}" id="img6"/></td>
<td><img src="data:image/png;base64, ${images[7]}" id="img7"/></td>
<td><img src="data:image/png;base64, ${images[8]}" id="img8"/></td>
</tr>
</table>
<input type="text" id="result"/>
<button type="button" id="submit">done</button>
div1=document.createElement("div");
div1.innerHTML = `$html`;
document.body.appendChild(div1);
var rotations = {
'img0': 0,
'img1': 0,
'img2': 0,
'img3': 0,
'img4': 0,
'img5': 0,
'img6': 0,
'img7': 0,
'img8': 0,
}
var txtField = document.getElementById('result');
var imageNodes = document.getElementsByTagName('IMG');
for (var i=0; i<imageNodes.length; i++) {
imageNodes[i].addEventListener('click', e => {
var target = e.currentTarget
var angle = (rotations[target.id] + 90) % 360;
rotations[target.id] = angle;
target.style.transform = 'rotate(' + angle + 'deg)';
var value = "";
for (const [key, vl] of Object.entries(rotations)) {
value = value + (vl / 90);
}
txtField.value = value;
})
}
var btn = document.getElementById("submit")
btn.addEventListener('click', e => {
var result = document.createElement("input");
result.id = "finalResult";
result.type = "text";
result.value = txtField.value;
document.body.appendChild(result);
})