Payment Management
Callback Status | Possible Actions |
---|---|
AUTHORIZED | CAPTURE CANCEL |
CAPTURED | REFUND |
FROZEN | await for callback-status AUTHORIZED or REJECTED |
What can I find here?
Capture payment
This call is used to capture a payment after the payment is created.
If no order lines are supplied, then all not yet captured order lines will be captured.
URL to capture payment: https://merchant-api.integration.resurs.com/v2/payments/{payment_id}/capture/captureture
Link to the call in swagger documentation: Capture Payment
Curl to capture the payment
curl –location –request POST ‘https://merchant-api.integration.resurs.com/v2/payments/{payment_id}/capture/c’–header ‘Content-Type: application/json’ \-header ‘Authorization: Bearer <TOKEN>’ \-data-raw ‘{ “creator”: “fictive@resurs.com”, “orderLines”: [ { “description”: “Book”, “quantity”: 1, “quantityUnit”: “pcs”, “vatRate”: 25, “totalAmountIncludingVat”: 500.0 } ] }
Refund payment
This call is used to refund a payment that is captured.
If no order lines are supplied, then all captured not yet refunded order lines will be refunded.
URL to refund payment: https://merchant-api.integration.resurs.com/v2/payments/{payment_id}/refund
Link to the call in swagger documentation: Refund Payment
Curl to refund the payment
curl –location –request POST ‘https://merchant-api.integration.resurs.com/v2/payments/{payment_id}/refund’–header ‘Content-Type: application/json’ \-header ‘Authorization: Bearer <TOKEN>’ \-data-raw ‘{ “creator”: “fictive@resurs.com”, “orderLines”: [ { “description”: “Book”, “quantity”: 1, “quantityUnit”: “pcs”, “vatRate”: 25, “totalAmountIncludingVat”: 500.0 } ] }
Cancel payment
This call is used to cancel a payment that is created but not yet captured.
If no order lines are supplied, everything that can be canceled will be canceled.
URL to cancel payment: https://merchant-api.integration.resurs.com/v2/payments/{payment_id}/cancel
Link to the call in swagger documentation: Cancel Payment
Curl to cancel the payment
curl –location –request POST ‘https://merchant-api.integration.resurs.com/v2/payments/{payment_id}/cancel’–header ‘Content-Type: application/json’ \-header ‘Authorization: Bearer <TOKEN>’ \-data-raw ‘{ “creator”: “fictive@resurs.com”, “orderLines”: [ { “description”: “Book”, “quantity”: 1, “quantityUnit”: “pcs”, “vatRate”: 25, “totalAmountIncludingVat”: 500.0 } ] }
Postman collection of the requests above
{
"info": {
"_postman_id": "57f6d60b-5681-4400-a608-29cd81f37add",
"name": "Payment management for partners",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Capture Payment",
"event": [
{
"listen": "test",
"script": {
"exec": [
"",
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"console.log('Capture payment v2');",
""
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"creator\": \"salesperson/system\",\n \"orderLines\": [\n {\n \"description\": \"Book\",\n \"quantity\": 1,\n \"quantityUnit\": \"pcs\",\n \"vatRate\": 25,\n \"totalAmountIncludingVat\": 500.0\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://merchant-api.integration.resurs.com/v2/payments//capture",
"protocol": "https",
"host": [
"merchant-api",
"integration",
"resurs",
"com"
],
"path": [
"v2",
"payments",
"",
"capture"
]
}
},
"response": []
},
{
"name": "Refund Payment",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"console.log('Capture payment v2');",
""
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"creator\": \"salesperson/system\",\n \"orderLines\": [\n {\n \"description\": \"Book\",\n \"quantity\": 1,\n \"quantityUnit\": \"pcs\",\n \"vatRate\": 25,\n \"totalAmountIncludingVat\": 500.0\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://merchant-api.integration.resurs.com/v2/payments//refund",
"protocol": "https",
"host": [
"merchant-api",
"integration",
"resurs",
"com"
],
"path": [
"v2",
"payments",
"",
"refund"
]
}
},
"response": []
},
{
"name": "Cancel Payment",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"console.log('Cancel payment v2');",
""
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"creator\": \"salesperson/system\",\n \"orderLines\": [\n {\n \"description\": \"Book\",\n \"quantity\": 1,\n \"quantityUnit\": \"pcs\",\n \"vatRate\": 25,\n \"totalAmountIncludingVat\": 500.0\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://merchant-api.integration.resurs.com/v2/payments//cancel",
"protocol": "https",
"host": [
"merchant-api",
"integration",
"resurs",
"com"
],
"path": [
"v2",
"payments",
"",
"cancel"
]
}
},
"response": []
}
]
}