В случае, если карта покупателя участвует в программе 3dsecure, то в ответе на запрос к методам purchase
или auth
будут присутствовать параметры для перехода на страницу банка, выпустивщего карту покупателя.
Последовательность операций
-
запрос
purchase
-
переадресация покупателя на
acsUrl
из ответа со следующими параметрами-
PaReq
- получено из запроса -
TermUrl
-URL
страницы клиента, на которую будет возвращен покупатель после прохождения проверки -
MD
- сгенерированные клиентом параметр, который будет передан обратно при возврате наTermUrl
. Обычно используется идентификации покупателя
-
-
запрос
complete3ds
с параметромpaRes
, полученным при возврате наTermUrl
.URL
формируется с подстановкойoperationId
, полученного в ответе на запросpurchase
Примеры запросов и ответов
Purchase
POST /card/1-1/operations/purchase HTTP/1.1
W1-Signature: BW0Z7MFPQS5GgIr4lqJm5UamXZaLpLo5wwykikymQDR82KkI5L3VyPeDIni4fBqbqsMdRg8ofSa8HSsdYZgPUSPQigP43D3OX0BFRAk/3sevRoh0BsAIxi8vTHaKAsVtHrfUptZXKrY+Adp/XShZz0LAJfxe76AIl7+vmnVTu94H6IH28u/H8ceFQp8vMwnuC8HJgiy6NlMZIP38FvwM5LvTgVRTidEQistsLNCb0L7dx14YBelwnHF533rwUl68iNLa07Q+ZPJa4EnNr+ytLF7wK7Aas+PwswLDuw78tstoyoLrKN9vgeouHdwYvOKGh0Ss8h8oxuvnDxuvhitW6Q==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 750
{
"notification" : {
"url" : "http://127.0.0.1:8080/test/callback/default/",
"version" : 1
},
"externalId" : "ext#14",
"amount" : {
"amount" : 10.55,
"currency" : "USD"
},
"payer" : {
"paymentMethod" : {
"entity" : {
"pan" : "4916798373459761",
"expMonth" : 5,
"expYear" : 2030,
"cvv" : "444"
},
"type" : "CARD"
},
"info" : {
"ip" : "127.0.0.1",
"phone" : "9001234567",
"email" : "no-reply@example.com"
}
},
"merchantParameters" : {
"param1" : "anything you want for callback",
"param2" : null,
"param3" : null
},
"registerRecurring" : true,
"tds" : {
"notificationUrl" : "http://tds.notification.url:6789"
}
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 295
{
"operationId" : "1-1-a-12",
"status" : "WAITING_FOR_CONFIRMATION",
"type" : "PURCHASE",
"externalId" : "ext#14",
"params" : {
"acsUrl" : "http://testacs:9191/test/acs/3ds1",
"PaReq" : "good"
},
"actions" : {
"required" : [ {
"type" : "complete3ds"
} ]
}
}
Complete3ds
POST /card/1-1/operations/1-1-a-53/complete3ds HTTP/1.1
W1-Signature: cUFTyBphNqPi0gPlFDut/nWaeBkXPQPN/FfmxMJLo3sr3fiiWlOPn8DETOBPy83P8sxVCQmKqBM6qFYEPIMEQTYYGd/sL81U8oQCvg4Qd2sv+2CkXj1BxagyEtsDl6sM6AdDEs7stvIGXo1HALw6nqdZRDXIkGQLHIXsexZ5GLJk2QtvnsrNNfzU2/KN2yGAlrFaUiLHZtS5Wq6cM6ICSAMqSk7s3tlXyLNu/KPX7wnPibZ91T7OqyDemRo0WxTE0wVMZ2suLriSVL9lOsGp4y7hZUj2deafDOCdj2OE2CqxKQckUlE2sIGBkeoHEg1nBytWjFiwJpS+eNrTIyYcLA==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 26
{
"paRes" : "verified"
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 168
{
"operationId" : "1-1-a-53",
"status" : "SUCCEEDED",
"type" : "PURCHASE",
"externalId" : "ext#64",
"params" : { },
"actions" : {
"required" : [ ]
}
}
Уведомление клиента со стороны Flexo (Callback)
POST /test/emptycallback HTTP/1.1
W1-Signature: G/YOqQZkMHeM4pR/1ilrnBsUDCzxz9502v4R9yr9QnpTr5PL1jKf5kv//ZT25e9MOs1XpgQBKnhlfvsnYdLDIb25kfSb7phZjeYh5OBlG5hrEiPw77KjAAdeNTEZ07GzpCvMm02H3SfMLpE/KkrCwNSUQbsmkQvNqX6CCB7MqXY0a2NyiHAkbMxftMJ4ftwRfCvt21nvHEVYMbvYkNlAKWTASqQO0cblyJFkNkdbeJwjN23bdWJRCW20JNDMHQbgOYdlbuAcNnJKBVVNJXTnnY/bO83arOXkFVhprqeqZVQzOHrCSVCuyXQmOrUGwo4GWDfIfaykgxZoZ5A+zNr1lw==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 880
{
"id" : "1-1-a-12",
"type" : "PURCHASE",
"externalId" : "ext#14",
"successful" : true,
"amount" : {
"amount" : 10.55,
"currency" : "USD"
},
"baseAmount" : {
"amount" : 10.55,
"currency" : "USD"
},
"registeredMethods" : [ {
"entity" : {
"id" : "1-2"
},
"type" : "RECURRING_TOKEN"
}, {
"entity" : {
"id" : "payoutToken-491679-something-9761"
},
"type" : "PAYOUT_TOKEN"
} ],
"merchantParameters" : {
"param1" : "anything you want for callback",
"param2" : null,
"param3" : null
},
"status" : "SUCCEEDED",
"transactions" : [ {
"type" : "PURCHASE",
"status" : "SUCCEEDED"
}, {
"type" : "COMPLETE3DS",
"status" : "SUCCEEDED"
} ],
"payer" : {
"paymentMethod" : {
"entity" : {
"pan" : "491679XXXXXX9761"
},
"type" : "MASKED_CARD"
}
}
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers