Checkout v2

Abort

Aborting a created payment.

Edit "Abort" on GitHub

Abort

To abort a payment order, perform the update-paymentorder-abort operation that is returned in the payment order response. You need to include the following in the request body:

Abort PATCH Request

Request

1
2
3
4
PATCH /psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json;version=3.x/2.0      // Version optional for 3.0 and 2.0
1
2
3
4
5
6
7
{
{
  "paymentorder": {
    "operation": "Abort",
    "abortReason": "CancelledByConsumer"
  }
}
Field Type Description
paymentOrder object The payment order object.
operation string Abort
abortReason string CancelledByConsumer or CancelledByCustomer. Why the payment was aborted.

Abort PATCH Response

The response given when aborting a payment order is equivalent to a GET request towards the paymentorders resource, as displayed above, with its state set to Aborted.

Response

1
2
3
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8; version=2.0
api-supported-versions: 2.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
    "paymentorder": {
        "id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce",
        "created": "2018-09-14T13:21:29.3182115Z",
        "updated": "2018-09-14T13:21:57.6627579Z",
        "operation": "Purchase",
        "state": "Ready",
        "currency": "SEK",
        "amount": 1500,
        "vatAmount": 0,
        "remainingCaptureAmount": 1500,
        "remainingCancellationAmount": 1500,
        "remainingReversalAmount": 0,
        "description": "Test Purchase",
        "initiatingSystemUserAgent": "swedbankpay-sdk-dotnet/3.0.1",
        "userAgent": "Mozilla/5.0...",
        "language": "nb-NO",
        "urls" : { "id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/urls" },
        "payeeInfo" : { "id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/payeeinfo" },
        "payers": { "id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/payers" },
        "orderItems" : { "id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/orderItems" },
        "metadata": { "id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/metadata" },
        "payments": { "id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/payments" },
        "currentPayment": { "id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/currentpayment" }
    },
    "operations": [
        {
            "method": "PATCH",
            "href": "https://api.externalintegration.payex.com/psp//09ccd29a-7c4f-4752-9396-12100cbfecce",
            "rel": "update-paymentorder-abort",
            "contentType": "application/json"
        },
        {
            "method": "GET",
            "href": "https://ecom.externalintegration.payex.com//5a17c24e-d459-4567-bbad-aa0f17a76119?_tc_tid=30f2168171e142d38bcd4af2c3721959",
            "rel": "redirect-paymentorder",
            "contentType": "text/html"
        },
        {
            "method": "GET",
            "href": "https://ecom.externalintegration.payex.com//core/scripts/client/px.paymentmenu.client.js?token=5a17c24e-d459-4567-bbad-aa0f17a76119&culture=nb-NO&_tc_tid=30f2168171e142d38bcd4af2c3721959",
            "rel": "view-paymentorder",
            "contentType": "application/javascript"
        }
    ]
}

Abort Payment Attempt