Direct payments
Start a payment with the method the shopper chose in your checkout, without Aera's checkout page.
Direct payments isn't a third checkout model. It's an extra option next to the hosted and embedded checkout, for a few cases where you already know how the shopper wants to pay. You show the payment options in your own checkout. When the shopper chooses one, you start the payment with Create direct payment session. Aera's checkout page is shown only if the shopper must authenticate.
Use it for:
| Payment method | method | What you send |
|---|---|---|
| A saved card (one-click) | CARD | The card's paymentInstrumentReference |
| Vipps | VIPPS | The shopper's mobile number (optional) and a payment text |
| Apple Pay | APPLEPAY | The Apple Pay token from your own Apple Pay integration |
How the response works
- No
paymentSessionUrlin the response: the payment was approved or declined without the shopper. CheckresponseInfo.responseCode, or call Get payment status. - A
paymentSessionUrlin the response: the shopper must do something, such as authenticate. Redirect the shopper to it, then handle the result as for the hosted checkout.
Keep the pspReference. All later operations, such as capture, cancel, refund, update and status, use it.
Pay with a saved card (one-click)
The shopper chose a card they saved earlier. Send its paymentInstrumentReference (from Get payment instruments) in paymentInstrumentsProfileData.
Example request: saved card
{
"merchantData": {
"successRedirectUrl": "https://shop.example.com/order/1234/success",
"cancelRedirectUrl": "https://shop.example.com/order/1234/cancel",
"errorRedirectUrl": "https://shop.example.com/order/1234/error"
},
"transactionData": {
"merchantReference": "order-1234",
"immediateCapture": true,
"amountDetails": { "amount": 10000, "currency": "NOK" }
},
"paymentInstrumentsProfileData": {
"merchantShopperId": "customer-10045",
"paymentInstrumentReference": "0192a7c4-5e1b-7d2a-8f3c-4b5a6c7d8e9f"
},
"paymentMethodInfo": {
"paymentMethodDetails": [ { "method": "CARD" } ]
}
}What happens:
- If the amount is below the low-value exemption limit (currently NOK 300 or EUR 30) and the card supports it, Aera tries a low-value exemption. If the issuer approves, the payment completes without the shopper, and there's no
paymentSessionUrl. - If the amount is above the limit, or the issuer soft-declines the exemption (asks for authentication), the response has a
paymentSessionUrl. Show it to the shopper. Authentication can be frictionless or need the shopper to act.
Pay with Vipps
Example paymentMethodInfo: Vipps MobilePay
"paymentMethodInfo": {
"paymentMethodDetails": [
{
"method": "VIPPS",
"vipps": {
"mobileNo": "+4711111111",
"paymentDescription": "Order 1234"
}
}
]
}| Field | Description |
|---|---|
mobileNo | The shopper's mobile number, in E.164 format. Vipps MobilePay uses it to confirm and authenticate the payment. Optional. |
paymentDescription | A short text the shopper sees in Vipps. Optional. |
The shopper approves the payment in the Vipps app. See Vipps.
Pay with Apple Pay
Use this when you run your own Apple Pay integration and get the payment token from Apple. Pass the token on unchanged.
Example paymentMethodInfo: Apple Pay
"paymentMethodInfo": {
"paymentMethodDetails": [
{
"method": "APPLEPAY",
"applePay": {
"poiChannel": "WEB",
"token": {
"paymentMethod": { "displayName": "Visa 1234", "network": "Visa", "type": "debit" },
"transactionIdentifier": "…",
"paymentData": { }
}
}
}
]
}See Apple Pay for the fields.
Good to know
- Send only one payment method in
paymentMethodDetails. immediateCaptureandsplitShipmentwork as for the hosted checkout. See Capture a payment.
Updated 4 days ago