Skip to content

Latest commit

 

History

History
85 lines (60 loc) · 3.51 KB

v1-migration.md

File metadata and controls

85 lines (60 loc) · 3.51 KB

Disclaimer

This is a work in progress. Issues and PRs are welcome.

Key differences

Landing page

Universal payment flows are essential for a good user experience. This is why the v2 API has a single, mandatory landing page for all payments. The initiate payment response will contain a unique URL to the landing page for each order.

Note: If the landing page realizes it's on a mobile browser it will switch to the Vipps app if it is installed.

Phone number is optional

The initiate payment call no longer requires a phone number. Instead, the user will be asked to fill in the phone number on the landing page. If phone number is included in the initiate payment body, then the landing page wil be "pre-filled" with that number.

Deeplink is automatically generated

If "isApp": false in the initiate payment body, then a https deeplink with a unique token for that specific order will be generated.

If "isApp": true then an appswitch deeplink with a unique token for that specific order will be generated.

Initiate payment example

See here for full overview of initiate payment

Request Body

{
   "customerInfo": {
       "mobileNumber": "48059528"
   },
   "merchantInfo": {
       "callbackPrefix": "https://www.callback.com/",
       "fallBack": "https://fallback.com/",
       "merchantSerialNumber": "210462",
       "isApp": true
   },
   "transaction": {
       "amount": 1234,
       "orderId": "id170",
       "timeStamp":"2020-06-24T08:34:25-07:00",
       "requestId": "1234",
       "transactionText": "Initiate Payment"
   }
}

Response body

{
    "orderId": "id170",
    "url": "vipps://?token=eyJraWQiOiJqd3RrZXkiLCJ <snip>"
}

Fallback URL is required

The initiate payment must contain a fallback URL. This is where the user will be redirect to after the payment. This is set in the initiate payment body.

For apps, this URL will be the appswitch-URL.

See here for details.

Migration

If you have already signed an agreement with Vipps, and have API keys for v1, you can use the same API keys for v2.

Subscription keys

When you have received confirmation that your new salesunit is created, then you can retrieve the keys in the developer portal. See the Getting started guide for full details

New endpoint

The v2 API is available at ecomm/v2/payments:

  • Test: https://apitest.vipps.no/ecomm/v2/payments
  • Prod: https://api.vipps.no/ecomm/v2/payments

Documentation

The v2 API documentation is available in markdown on GitHub

Technical documentation is available in swagger-format here

We highly recommend going through the whole flow using our Postman collection and environment following our guide.