{
"error":{
"code":null,
"message":"Ваш запрос недействителен!",
"details":"При проверке были обнаружены следующие ошибки - 'Amount' должно быть заполнено.",
"data":{
},
"validationErrors":[
{
"message":"'Amount' должно быть заполнено.",
"members":[
"amount"
]
}
]
}
}
POST https://api.wata.pro/api/h2h/links
Content-Type: application/json
Authorization: Bearer <access-token>
{
"amount": 1188.00,
"currency": "RUB",
"description": "string",
"orderId": "string",
"successRedirectUrl": "string",
"failRedirectUrl": "string",
"expirationDateTime": "2024-15-03T12:09:33.390Z"
}
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"amount": 1188.00,
"currency": "RUB",
"status": "Opened",
"url": "string",
"terminalName": "string",
"terminalPublicId": "3fa85f22-2108-1749-a7gj-9c134g55hkl0",
"creationTime": "2024-12-03T12:09:33.390Z",
"orderId": "string",
"description": "string",
"successRedirectUrl": "string",
"failRedirectUrl": "string",
"expirationDateTime": "2024-15-03T12:09:33.390Z"
}
GET https://api.wata.pro/api/h2h/links/3fa85f64-5717-4562-b3fc-2c963f66afa6
Content-Type: application/json
Authorization: Bearer <access-token>
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"amount": 1188.00,
"currency": "RUB",
"status": "Opened",
"url": "string",
"terminalName": "string",
"terminalPublicId": "3fa85f22-2108-1749-a7gj-9c134g55hkl0",
"creationTime": "2024-12-03T12:09:33.390Z",
"orderId": "string",
"description": "string",
"successRedirectUrl": "string",
"failRedirectUrl": "string",
"expirationDateTime": "2024-15-03T12:09:33.390Z"
}
GET https://api.wata.pro/api/h2h/links/?amountFrom=10¤cies=RUB&statuses=Opened&sorting=OrderId&skipCount=5&maxResultCount=5
Content-Type: application/json
Authorization: Bearer <access-token>
{
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"amount": 1188.00,
"currency": "RUB",
"status": "Opened",
"url": "string",
"terminalName": "string",
"terminalPublicId": "3fa85f22-2108-1749-a7gj-9c134g55hkl0",
"creationTime": "2024-12-06T16:47:29.106Z",
"orderId": "string"
}
],
"totalCount": 0
}
<html>
<head>
<title></title>
</head>
<body onload="setTimeout(document.forms['form'].submit(), 10000)">
<form name='form' action='{url}' method='{method}'>
<input type='hidden' name='creq' value='{creq}'>
<input type='hidden' name='threeDSSessionData' value='{threeDsSessionData}'>
</form>
</body>
</html>
POST https://api.wata.pro/api/h2h/payments/card-crypto
Content-Type: application/json
Authorization: Bearer <access-token>
{
"amount":100,
"currency":"RUB",
"description":"string",
"orderId":"string",
"deviceData":{
"browserAcceptHeader":"text/html,application/xml",
"browserLanguage":"ru",
"browserJavaEnabled":true,
"browserJavaScriptEnabled":true,
"browserColorDepth":24,
"browserScreenHeight":1080,
"browserScreenWidth":1920,
"challengeWindowWidth":1080,
"challengeWindowHeight":1920,
"browserTz":3,
"browserTzName":"UTC+3",
"browserUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
},
"ip":"185.215.60.77",
"returnUrl":"https://merchant.site/result",
"cardCrypto":"string"
"email":"merchant@wata.pro"
}
{
"transactionId":"3a16a4f0-27b0-09d1-16da-ba8d5c63eae3",
"transactionStatus": "Pending",
"threeDsData": {
"url": "https://acs.site",
"method": "POST",
"parameters": {
"creq": "string",
"threeDSSessionData": "string",
}
}
}
POST https://api.wata.pro/api/h2h/payments/sbp
Content-Type: application/json
Authorization: Bearer <access-token>
{
"amount":100,
"description":"string",
"orderId":"string",
"deviceData":{
"browserAcceptHeader":"text/html,application/xml",
"browserLanguage":"ru",
"browserJavaEnabled":true,
"browserJavaScriptEnabled":true,
"browserColorDepth":24,
"browserScreenHeight":1080,
"browserScreenWidth":1920,
"challengeWindowWidth":1080,
"challengeWindowHeight":1920,
"browserTz":3,
"browserTzName":"UTC+3",
"browserUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
},
"ip":"185.215.60.77",
"returnUrl":"https://merchant.site/result"
}
{
"transactionId":"3a16a4f0-27b0-09d1-16da-ba8d5c63eae3",
"transactionStatus":"Pending",
" sbpLink ":"string"
}
GET https://api.wata.pro/api/h2h/transactions/3a16a4f0-27b0-09d1-16da-ba8d5c63eae3
Content-Type: application/json
Authorization: Bearer <access-token>
{
"terminalName": "string",
"terminalPublicId": "3a16a4dd-8c83-fa4d-897a-3b334ed0ebed",
"type": "CardCrypto",
"amount": 1188.00,
"currency": "RUB",
"status": "Paid",
"errorCode": null,
"errorDescription": null,
"orderId": "string",
"orderDescription": "string",
"creationTime": "2024-12-04T17:41:33.744768Z",
"paymentTime": "2024-12-04T17:41:44.434598Z",
"totalCommission": 10,
"sbpLink": null,
"paymentLinkId": null,
"id": "3a16a4f0-27b0-09d1-16da-ba8d5c63eae3"
}
GET https://api.wata.pro/api/h2h/transactions/?amountFrom=10¤cies=RUB&statuses=Paid&sorting=OrderId&skipCount=0&maxResultCount=5
Content-Type: application/json
Authorization: Bearer <access-token>
{
"totalCount": 1,
"items": [
{
"terminalName": "string",
"terminalPublicId": "3a16a4dd-8c83-fa4d-897a-3b334ed0ebed",
"type": "CardCrypto",
"amount": 1188.00,
"currency": "RUB",
"status": "Paid",
"errorCode": null,
"errorDescription": null,
"orderId": "string",
"orderDescription": "string",
"creationTime": "2024-12-05T10:32:07.739314Z",
"paymentTime": "2024-12-05T10:32:07.739314Z ",
"totalCommission": 10,
"sbpLink": null,
"paymentLinkId": null,
"id": "3a16a4f0-27b0-09d1-16da-ba8d5c63eae3"
}
]
}
<?php
class SignatureVerificationService {
public static function verify($rawWebhookJson, $signature, $publicKey) {
$publicSignature = openssl_get_publickey($publicKey);
$signatureBytes = base64_decode($signature);
$result = openssl_verify($rawWebhookJson, $signatureBytes, $publicSignature, OPENSSL_ALGO_SHA512);
openssl_free_key($publicSignature);
return $result === 1;
}
}
import java.security.PublicKey;
import java.security.Signature;
import java.util.Base64;
import static java.nio.charset.StandardCharsets.UTF_8;
public class SignatureVerificationService {
public static boolean verify(String rawWebhookJson, String signature, PublicKey publicKey) throws Exception {
Signature publicSignature = Signature.getInstance("SHA512withRSA");
publicSignature.initVerify(publicKey);
publicSignature.update(rawWebhookJson.getBytes(UTF_8));
byte[] signatureBytes = Base64.getDecoder().decode(signature);
return publicSignature.verify(signatureBytes);
}
}
GET https://api.wata.pro/api/h2h/public-key
Content-Type: application/json
{
"value": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoL3WIP92OShyu4Y+ecbS\nZJQyU2AW7gbg8X3KqX7dkctQL54kcxvpMySR8UMjZOCSzLuly2BFHP1pNVMPF304\nuIVpRtHtwEw3k3qE259L/7xEJHSzfehHuMlfSng7Lh/HxLW93douDCwohJvAISwF\ncXlqmNo/eJfBu9kQNlclQXFMYLHOtotZbsMM/oAJJvks7bgnN5o9RXMx8SG5rfq/\naK+BZAlEC83HTpnVrv0wpjmeleSPDSiOkWIY6BBTcg1bpH162en9XasJ/xnHLBFY\nkQSjFQw8nN17CFpd5Hkb0QpABgSEVStvaeLHF5XrWi3B/x5v8sUKsEgUnOJ7LnlH\nHQIDAQAB\n-----END PUBLIC KEY-----"
}
Content-Type: application/json
X-Signature: <signature>
{
"transactionType": "CardCrypto",
"transactionId": "3a16a4f0-27b0-09d1-16da-ba8d5c63eae3",
"transactionStatus": "Paid",
"errorCode": null,
"errorDescription": null,
"terminalName": "string",
"amount": 1188.00,
"currency": "RUB",
"orderId": "string",
"orderDescription": "string ",
"paymentTime": "2024-12-04T17:41:44.434598Z ",
"commission": 10,
"email": null
}
eyJUeXBlIjoiQ2xvdWRDYXJkIiwibWV0YURhdGEiOnsiUGF5bWVudFVybCI6Imh0dHBzOi8vZGV2ZWxvcGVycy5jbG91ZHBheW1lbnRzLnJ1LyIsIlJlZmVycmVyVXJsIjoiaHR0cHM6Ly9kZXZlbG9wZXJzLmNsb3VkcGF5bWVudHMucnUvIn0sI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YVBlR29iUGN0MExvZGorZm5hVVBCcEZ0V3RBVVhMb285NWtYT0hKQmxFbWRzZXA5Mkw5Y3d0QXdwRzF3MlNnbk9LT3R6dHplNFB4NkJIQXZINndKQ1VQZzIrMUpzWjRxMUl5dzhnPT0ifQ==
<script src="https://static.wata.pro/checkout.js"></script>
const сheckout = window.WataCheckout();
const cardData = {
number: "4242424242424242",
expirationMonth: 12,
expirationYear: 28,
cvv: '333',
cardHolderName:'IVAN IVANOV',
};
const errors = сheckout.validate(cardData)
type ValidatonErrors = {
data?: string;
number?: string;
expirationMonth?: string;
expirationYear?: string;
cvv?: string;
}
const encryptedData = await сheckout.encrypt(cardData);
const deviceData = сheckout.getDeviceData();