Digital Payments

Expand The First Payment Method

Auto-expand the first payment method in your menu.

Edit "Expand The First Payment Method" on GitHub

Expand the First Payment Method

A useful feature when customizing your payment UI, is auto-expanding the first payment method in the menu. By doing this you can guide the payer towards a specific payment method. This is done by adding the boolean field expandFirstInstrument and set it to true. The first method will be expanded when the payment UI is loaded. This can be used as a stand-alone feature, but can favourably be paired with customizing the order of the menu.

Request Example

The request with expandFirstInstrument set to true should look like the example below.

The field will not be visible in the response, so we will only include the request here. The response will look like a basic paymentOrder response.

Request

1
2
3
4
POST /psp/paymentorders HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json;version=3.1,3.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
{
    "paymentorder": {
        "expandFirstInstrument": true,
        "operation": "Purchase",
        "currency": "SEK",
        "amount": 1500,
        "vatAmount": 375,
        "description": "Test Purchase",
        "userAgent": "Mozilla/5.0...",
        "language": "sv-SE",
        "urls": {
            "hostUrls": [ "https://example.com", "https://example.net" ], //Seamless View only
            "paymentUrl": "https://example.com/perform-payment", //Seamless View only
            "completeUrl": "https://example.com/payment-completed",
            "cancelUrl": "https://example.com/payment-cancelled", //Redirect only
            "callbackUrl": "https://api.example.com/payment-callback",
            "logoUrl": "https://example.com/logo.png" //Redirect only
        },
        "payeeInfo": {
            "payeeId": "5cabf558-5283-482f-b252-4d58e06f6f3b",
            "payeeReference": "AB832",
            "payeeName": "Merchant1",
            "orderReference": "or-123456"
        }
    }
}