По переходу операции в конечный статус на адрес, переденный в запросе в поле notification.url
отправляется нотификация.
-
метод: POST
-
структура в формате swagger
-
в заголовке передается подпись. Правила формирования
-
публичный ключ для проверки подписи:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs7NA6ot9a53nxGYelM89
o1imFac04hED3sS8cwzFxi2rxUNQXl2tEiWIHzGy2sEFLDfeN2lvEVCONl7pXlDP
fpFPBNPy6zfSRMq32t319MDOkykBRTRE4GDlU+MPm/u/UOGuHSaFLKKKXVZVyk6o
9K+hI9UfVE5FNjF04vWBrgcnwWQ9+hqNE9EhqxELoQdhbcUz3PnBkjWRKlBXnUBo
9HrboTaRUr+YkyTh6Kh/afQHreKXy8yA0arTT4mpeb5PL06g0B9Ejn4m+wHPN8DW
feY8U8QImoaDT5n+ngxMpqIXv2kokPBATlpno3uj9fKcxivqvEbtNrAA5wRM17Bq
WwIDAQAB
-----END PUBLIC KEY-----
Пример уведомления (версия 2)
POST /test/emptycallback HTTP/1.1
W1-Signature: Ie6cBZB26arbMV6D71NzqIzvjNQ4XIk8MSBd8CZAC0Mz4zoOf/puj58ubVh5HBzhXtreDvFmDMeXZiM3+uPM0xkoRDunVENkqmuAeXfeFIZ1h+L2QV9Gl9gPmd6/b7bzM6dCe3rgu1QWIDbLMztTL3TbL734Cbtj5oQ74boT08PdLPNifYuO+gft0vNzMiBCrCL6BWcwNBXdPOKEAH2HD+cGu56vJ+sdOLLfy+BiFAX+fkoefZ/J/rA5k+kUC2oUPlntrvAAo5SYOlucZY061U9QF5gJ/FZhmiC+2o72u2IRGAHnxg4/ob50w3nQiuQDDDBJrWW1ti8JHsoy1IKQ6g==
Content-Type: application/json; charset=UTF-8
Host: localhost:8080
Content-Length: 723
{
"id" : "1-6-a-365",
"type" : "REFUND",
"status" : "SUCCEEDED",
"externalId" : "ext#54",
"amounts" : {
"amount" : {
"amount" : 5.0,
"currency" : "USD"
},
"payerAmount" : {
"amount" : 7.5,
"currency" : "USD"
},
"merchantFee" : {
"amount" : 0.0,
"currency" : "USD"
},
"payerFee" : {
"amount" : 2.5,
"currency" : "USD"
},
"settlementAmount" : {
"amount" : -5.0,
"currency" : "USD"
}
},
"registeredMethods" : [ ],
"merchantParameters" : {
"param1" : "anything you want for callback"
},
"transactions" : [ {
"type" : "REFUND",
"status" : "SUCCEEDED",
"maskedPan" : "411111XXXXXX1111"
} ]
}
HTTP/1.1 200 OK
Date: Fri, 26 Nov 2021 13:08:24 GMT
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Пример уведомления (версия 3)
POST /test/emptycallback HTTP/1.1
W1-Signature: Ie6cBZ...
Content-Type: application/json; charset=UTF-8
Host: localhost:8080
Content-Length: 1256
{
"id": "1-1-a-1",
"type": "PURCHASE",
"status": "SUCCEEDED",
"externalId": "abc",
"chargedAmounts": {
"amount": {
"amount": 5.55,
"currency": "USD"
},
"payerAmount": {
"amount": 5.57,
"currency": "USD"
},
"merchantFee": {
"amount": 0,
"currency": "USD"
},
"payerFee": {
"amount": 0.02,
"currency": "USD"
},
"settlementAmount": {
"amount": 5.55,
"currency": "USD"
}
},
"amounts": {
"amount": {
"amount": 10.55,
"currency": "USD"
},
"payerAmount": {
"amount": 10.57,
"currency": "USD"
},
"merchantFee": {
"amount": 0,
"currency": "USD"
},
"payerFee": {
"amount": 0.02,
"currency": "USD"
},
"settlementAmount": {
"amount": 0,
"currency": "USD"
}
},
"registeredMethods": [
{
"entity": {
"id": "payoutToken-411111-something-1111"
},
"type": "PAYOUT_TOKEN"
}
],
"merchantParameters": {
"param1": "1",
"param2": "2",
"param3": "3"
},
"transactions": [
{
"type": "PURCHASE",
"status": "SUCCEEDED",
"maskedPan": "411111XXXXXX1111",
"rejectReason": null
}
]
}
HTTP/1.1 200 OK
Date: Fri, 26 Nov 2021 13:08:24 GMT
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers