Skip to main content

Static QR directing to the app for payment

This flow uses a QR code that is posted on the vending machine. The QR directs the user to the payment screen in their Vipps or MobilePay app.

When to use​

This QR code can be used when you don't have a screen, and it's not possible to present the dynamic one-time payment QR.

Prerequisites​

Merchant Callback QR​

Generate a merchant callback QR code.

Details​

A Vipps MobilePay QR code is posted on the vending machine.

When the customer scans the QR code, they go directly to the payment screen on their phone, where they can approve the payment.

The payment amount should be the max amount of the vending machine products. After reservation, the amount of the selected product must be captured, and the remaining amount must be released.

Step 1: User scans the QR​

When the user scans the QR code, a user.checked-in.v1 webhook event is sent to your backend, containing the customerToken for the user. The user will see a message telling them to choose the product on the vending machine. Webhook for QR code.

Step 2: Initiate a payment request​

Create a Payment request to the customerToken from the webhook. You may attach order details at the same time.

Specify "userFlow": "WEB_REDIRECT" to redirect user to the app. Per regulations, specify "customerInteraction": "CUSTOMER_PRESENT".

Detailed example of payment request

Specify the amount of the most expensive item in your vending machine so that any selection they make can be successful.

Specify "customerInteraction": "CUSTOMER_PRESENT". Specify "userFlow": "WEB_REDIRECT" to redirect user to the app.

Here is an example HTTP POST:

POST:/epayment/v1/payments

With body:

{
"amount": {
"value": 5000,
"currency": "NOK"
},
"paymentMethod": {
"type": "WALLET"
},
"customer": {
"customerToken": "wbA8ceVRKkoYiQAVELHeFCC3Sn5dtNCvvEtVPiOT77j6wx7uR965AG6Q+q0ATP4="
},
"customerInteraction": "CUSTOMER_PRESENT",
"reference": 2486791679658155992,
"userFlow": "PUSH_MESSAGE",
"paymentDescription": "Vending machine purchase"
}

Step 3: Customer authorizes the payment​

The payment request will appear in the customer's Vipps or MobilePay app, where they can select to pay or cancel.

To determine that the user has authorized the payment, you can get notifications via the Webhooks API and/or poll for the status.

Once the payment is approved, update the status in your system.

Step 4. Capture the amount due​

After the selection is made, determine how much the customer owes and provide order details. After final amount is confirmed, do a partial capture. Use the capture endpoint to capture the amount due.

🚩Remember to check the status of the captured payment.

Step 5 Cancel remaining amount​

Use the cancel endpoint to release the remaining amount from the reservation. For more details, see cancel after a partial capture.

Sequence diagram​

Integration sequence for the vending machine flow with static QR directing to the app for payment.

Static QR directing to the app

Next steps​

Explore the other flows in this section. When you are ready to learn about the technical details, review some related pages:

Help us improve our documentation

Did you find what you were looking for?