Operations
When a payment order resource is created and during its lifetime, it will have a set of operations that can be performed on it. The state of the payment order resource, what the access token is authorized to do, the chosen payment method and its transactional states, etc. determine the available operations before the initial purchase. A list of possible operations and their explanation is given below.
Operations
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
{
"paymentorder": {
"id": "/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce",
},
"operations": [
{
"method": "PATCH",
"href": "https://api.externalintegration.payex.com/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce",
"rel": "update-order",
"contentType": "application/json"
},
{
"method": "PATCH",
"href": "https://api.externalintegration.payex.com/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce",
"rel": "abort",
"contentType": "application/json"
},
{
"method": "PATCH",
"href": "https://api.payex.com/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce",
"rel": "abort-paymentattempt",
"contentType": "application/json"
},
{
"method": "POST",
"href": "https://api.externalintegration.payex.com/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/cancellations",
"rel": "cancel",
"contentType": "application/json"
},
{
"method": "POST",
"href": "https://api.externalintegration.payex.com/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/captures",
"rel": "capture",
"contentType": "application/json"
},
{
"method": "POST",
"href": "https://api.externalintegration.payex.com/psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce/reversals",
"rel": "reversal",
"contentType": "application/json"
},
{
"method": "GET",
"href": "https://ecom.externalintegration.payex.com/checkout/073115b6226e834dd9b1665771bae76223b4488429729155587de689555c5539?_tc_tid=30f2168171e142d38bcd4af2c3721959",
"rel": "redirect-checkout",
"contentType": "text/html"
},
{
"method": "GET",
"href": "https://ecom.externalintegration.payex.com/checkout/core/js/px.checkout.client.js?token=073115b6226e834dd9b1665771bae76223b4488429729155587de689555c5539&culture=sv-SE&_tc_tid=30f2168171e142d38bcd4af2c3721959",
"rel": "view-checkout",
"contentType": "application/javascript"
},
{
"method": "GET",
"href": "https://api.externalintegration.payex.com/psp/paymentsessions/b0bb522437a5c9fa3783f7ba30680bef0c32b3de0fafe568bec6dbadfa7da8cf?_tc_tid=d49b520fa0314bcca78c75806dee8a17",
"rel": "view-paymentsession",
"contentType": "application/json"
}
]
}
Field | Type | Description |
---|---|---|
method |
string |
GET , PATCH , POST , etc. The HTTP method to use when performing the operation. |
href |
string |
The target URL to perform the operation against. |
rel |
string |
The name of the relation the operation has to the current resource. |
contentType |
string |
The HTTP content type of the resource referenced in the href field. |
The operations should be performed as described in each response and not as
described here in the documentation. Always use the href
and method
as
specified in the response by finding the appropriate operation based on its
rel
value. The only thing that should be hard coded in the client is the value
of the rel
and the request that will be sent in the HTTP body of the request
for the given operation.
Operation | Description |
---|---|
update-order |
Updates the order with a change in orderItems , amount and/or vatAmount . |
abort |
Aborts the payment order before any financial transactions are performed. |
abort-paymentattempt |
Aborts the payment attempt, but not the order as a whole, before any financial transactions are performed. |
cancel |
Used to cancel authorized and not yet captured transactions. If a cancellation is performed after doing a part-capture, it will only affect the not yet captured authorization amount. |
capture |
The second part of a two-phase transaction where the authorized amount is sent from the payer to the payee. It is possible to do a part-capture on a subset of the authorized amount. Several captures on the same payment are possible, up to the total authorization amount. |
reversal |
Used to reverse a payment. It is only possible to reverse a payment that has been captured and not yet reversed. |
redirect-checkout |
Contains the URL used to redirect the payer to the Swedbank Pay Payments containing the Payment Menu. |
view-checkout |
Contains the JavaScript href that is used to embed the Payment Menu UI directly on the webshop/merchant site. |
view-paymentsession |
Contains the href used by merchants to launch our new SDK. |