UAPAY - національний платіжний сервіс
Confirmation of payment 3DS
After the response to the method POST/api/payments/p2p/show was received data.status=NEEDS_CONFIRMATION and data.confirmation.type=3DS, it is necessary to redirect the user to the ACS page of the issuing bank to perform payment confirmation.
To do this, you need to perform a method query POST to URL data.confirmation.url. If there are parameters in the object data.confirmation.form - parameters must be passed in the request (all of them are optional). You must pass the TermUrl parameter, it must be formed according to the URL + query string parameters: id, redirect, key (not mandatory):
${redirectUrl}?id=${redirectParamsId}&key=${key}&redirect=${redirect}
Where:
${redirectUrl} - field value data.redirect.url from the response to the payment status request
${redirectParamsId} - field value data.redirect.params.id from the response to the payment status request
${key} - field value data.key з відповіді on the payment creation request
${redirect} - URL to redirect to after ACS page verification is complete (usually merchant page URL)
An example of a method response POST /api/payments/p2p/show:
{
"status":1,
"data":{
"id":"6bb07565-6602-4482-b695-bbf410506a7d",
"status":"NEEDS_CONFIRMATION",
"number":"16851",
"amount":100,
"externalId":"123",
"recipient":{
"phone":"380961234567",
"email":null
},
"confirmation":{
"type":"3DS",
"url":"https://acs.privatbank.ua/pPaReqMC.jsp",
"form":{
"PaReq":"eJxVUttOwzAMfd5fVHxAc1nTtVOINNgDk+g0wXjYE6o6i3WwrEtaYHw9dtqhESmqfY5j99jW650DmD9D1TkwugDvyzeI6u3tzWr2BKdXoWSaJmMpJ6lKbsxIB9iMRvoTnK+P1oiYx1Kzi4tMU1qjxulYJTLlUqlMcaUZoUgW4KpdaVu0R7qsTneLpcEaeSo0G1xiDuAWc8P7I/sPRvQwBdjyAGYNvo0uGaN16R9r+x5pFkiKqo6dbd3ZZDzR7OIQ0bkPs2vbZsqYkBOUwGMxHeNhxWrBnsA3R+th5Y4VtqS2b/HeN5rRK3zMrkToVUe27+t911tTrF/Oy/2GFz+L8/JnI5bz2VfR31vNKIIit2ULRnKRcSWySCRYfJpMNAt46M2BftekMekeHMIbqjcbSOKugaC5cw5sdTZ5xlH0xSMKvlEWYBwO7M8mQVci9P3DMJuqxV7LTOYqyZXkExpQwIZUNfYSR5OHXHVorGb0GvOFLaFGhYVC69+i/QK+brnK"
}
},
"redirect":{
"url":"https://api.demo.uapay.ua:443/api/payments/p2p/confirm",
"params":{
"id":"6bb07565-6602-4482-b695-bbf410506a7d"
}
}
}
}
To make a POST request to the issuing bank, you need to create and call an HTML form.
Example with use JavaScript:
<!DOCTYPE html>
<html>
<head>
<title>Example call ACS</title>
</head>
<body>
<script type="text/javascript">
var form = document.createElement('form');
form.setAttribute('method', 'POST');
form.setAttribute('action', data.confirmation.url);
var paReq = document.createElement('input');
paReq.setAttribute('type', 'hidden');
paReq.setAttribute('name', 'PaReq');
paReq.setAttribute('value', data.confirmation.form.PaReq);
form.appendChild(paReq);
var md = document.createElement('input');
md.setAttribute('type', 'hidden');
md.setAttribute('name', 'MD');
md.setAttribute('value', data.confirmation.form.MD);
form.appendChild(md);
var termUrl = document.createElement('input');
termUrl.setAttribute('type', 'hidden');
termUrl.setAttribute('name', 'TermUrl');
termUrl.setAttribute('value', termUrl);
form.appendChild(termUrl);
document.body.appendChild(form);
form.submit();
</script>
</body>
</html>
After the user returns to the page, it is necessary to continue sending the show request until the final payment status is received.
UAPAY - національний платіжний сервіс
pay@uapay.ua