Abort
To abort a payment order, perform the 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
5
6
7
8
9
10
11
PATCH /psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json
{
"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
status
set to Aborted
.
Response
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
HTTP/1.1 200 OK
Content-Type: application/json
{
"paymentOrder": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd",
"created": "2022-01-24T10:54:05.6243371Z",
"updated": "2022-01-24T10:54:19.2679591Z",
"operation": "Purchase",
"status": "Aborted",
"currency": "SEK",
"amount": 32000,
"vatAmount": 0,
"description": "Abort test",
"initiatingSystemUserAgent": "swedbankpay-sdk-dotnet/3.0.1",
"language": "sv-SE",
"availableInstruments": [
"CreditCard",
"Invoice-PayExFinancingSe",
"Invoice-PayMonthlyInvoiceSe",
"Swish",
"CreditAccount",
"Trustly"
],
"implementation": "Business",
"instrumentMode": false,
"guestMode": false,
"orderItems": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/orderitems"
},
"urls": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/urls"
},
"payeeInfo": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/payeeinfo"
},
"payer": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/payers"
},
"history": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/history"
},
"failed": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/failed"
},
"aborted": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/aborted"
},
"paid": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/paid"
},
"cancelled": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/cancelled"
},
"financialTransactions": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/financialtransactions"
},
"failedAttempts": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/failedattempts"
},
"metadata": {
"id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/metadata"
}
},
"operations": [
]
}
Field | Type | Description |
---|---|---|
paymentorder |
object |
The payment order object. |
└➔ id
|
string |
The relative URL and unique identifier of the paymentorder resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
└➔ created
|
string |
The ISO-8601 date of when the payment order was created. |
└➔ updated
|
string |
The ISO-8601 date of when the payment order was updated. |
└➔ operation
|
string |
Purchase |
└➔ status
|
string |
Initialized , Paid , Failed , Cancelled or Aborted . Indicates the state of the payment order. |
└➔ currency
|
string |
The currency of the payment order. |
└➔ amount
|
integer |
The transaction amount (including VAT, if any) entered in the lowest monetary unit of the selected currency. E.g.: 10000 = 100.00 SEK, 5000 = 50.00 SEK. The amount displayed is the final amount the payer paid for their order, including any instrument specific discounts or fees. |
└➔ vatAmount
|
integer |
The payment’s VAT (Value Added Tax) amount , entered in the lowest monetary unit of the selected currency. E.g.: 10000 = 100.00 SEK, 5000 = 50.00 SEK. The vatAmount entered will not affect the amount shown on the payment page, which only shows the total amount . This field is used to specify how much of the total amount the VAT will be. Set to 0 (zero) if there is no VAT amount charged. |
└➔ description
|
string(40) |
A 40 character length textual description of the purchase. |
└➔ initiatingSystemUserAgent
|
string |
The user agent of the HTTP client making the request, reflecting the value sent in the User-Agent header with the initial POST request which created the Payment Order. |
└➔ language
|
string |
sv-SE , nb-NO , da-DK , en-US or fi-FI . |
└➔ availableInstruments
|
string |
A list of instruments available for this payment. |
└➔ implementation
|
string |
The merchant’s Checkout v3 implementation type. Business , Enterprise , PaymentsOnly or Starter . |
└➔ integration
|
string |
The merchant’s Checkout v3 integration type. HostedView (Seamless View) or Redirect . |
└➔ instrumentMode
|
bool |
Set to true or false . Indicates if the payment is initialized with only one payment instrument available. |
└➔ guestMode
|
bool |
Set to true or false . Indicates if the payer chose to pay as a guest or not. When using the Payments Only implementation, this is triggered by not including a payerReference in the original paymentOrder request. |
└➔ orderItems
|
string |
The URL to the orderItems resource where information about the order items can be retrieved. |
└➔ urls
|
string |
The URL to the urls resource where information about the urls can be retrieved. |
└➔ payeeInfo
|
string |
The URL to the payeeInfo resource where information about the payee (the one who receives the funds) can be retrieved. |
└➔ payer
|
string |
The URL to the payer resource where information about the payer can be retrieved. |
└➔ history
|
string |
The URL to the history resource where information about the payment’s history can be retrieved. |
└➔ failed
|
string |
The URL to the failed resource where information about the failed transactions can be retrieved. |
└➔ aborted
|
string |
The URL to the aborted resource where information about the aborted transactions can be retrieved. |
└➔ paid
|
string |
The URL to the paid resource where information about the paid transactions can be retrieved. |
└➔ cancelled
|
string |
The URL to the cancelled resource where information about the cancelled transactions can be retrieved. |
└➔ financialTransactions
|
string |
The URL to the financialTransactions resource where information about the financial transactions can be retrieved. |
└➔ failedAttempts
|
string |
The URL to the failedAttempts resource where information about the failed attempts can be retrieved. |
└➔ metadata
|
string |
The URL to the metadata resource where information about the metadata can be retrieved. |
└➔ operations
|
array |
The array of possible operations to perform, given the state of the payment order. See Operations for details. |