Checkout v2

Introduction

schedule 3 min read

Swedbank Pay Checkout is a complete reimagination of the checkout experience, integrating seamlessly into the merchant website through highly customizable and flexible components. Visit our demoshop and try out Swedbank Pay Checkout for yourself!

Edit "Introduction" on GitHub

Swedbank Pay Checkout allows your customers to be identified by Swedbank Pay, enabling existing Swedbank Pay Checkout users to pay with their favorite payment methods in just a few simple steps.

Prerequisites

To start integrating Swedbank Pay Checkout, you need the following:

  • HTTPS enabled web server.
  • Agreement that includes Swedbank Pay Checkout.
  • Obtained credentials (merchant Access Token) from Swedbank Pay through Swedbank Pay Admin. Please observe that Swedbank Pay Checkout encompass both the consumer and paymentmenu scope.

Introduction

To get started with Swedbank Pay Checkout, you should learn about its different components and how they work together. Swedbank Pay Checkout consists of two related, but disconnected concepts: Checkin and Payment Menu. Checkin identifies the consumer in our Consumer API and Payment Menu authorizes the payment with our Payment Menu API.

The next step is to Capture the payment. You can either capture the total amount, or do a part-capture (as described under After Payment). Connect these steps and you have Swedbank Pay Checkout.

While Checkin is a necessary component to store personal information and access features like storing cards, it is not a mandatory step for the Checkout process to work. If the payer is from a country where we currently don’t support Checkin, or if he or she opts not to store their data, that’s fine. The Payment Menu can still be used as a guest.

Sequence

Below, you will find sequence diagrams visualizing the sequence of Swedbank Pay Checkout. The parties involved in the sequences are:

  • Payer refers to the front-end code that runs in the web browser (JavaScript events as well as user interaction).
  • Merchant refers to the merchant back-end server.
  • Swedbank Pay refers to the Swedbank Pay API.

Checkin

The first operation in the Checkout process is to identify the payer. This step is called Checkin and is visualized in the below diagram.

PayerPayerMerchantMerchantSwedbank PaySwedbank PayStart CheckinPOST /psp/consumersrel:view-consumer-identificationrel:view-consumer-identification<script src=rel:view-consumer-identification.href />payex.hostedView.consumer()Consumer identificationonConsumerIdentified(consumerProfileRef)POST { consumerProfileRef }StoreconsumerProfileRef
  1. rel:view-consumer-identification is a value in one of the operations, sent as a response from Swedbank Pay to the Merchant.
  2. Show Checkin creates and displays the Checkin Seamless View.
  3. Consumer identification is a simplified view of what happens inside the Checkin Seamless View in order to identify the payer.
  4. onConsumerIdentified(consumerProfileRef) is an event that triggers when the consumer has been identified, and delivers the field consumerProfileRef as a reference to be used when creating the Payment Order that will be used to display the Payment Menu.
  5. POST { consumerProfileRef } ensures that the consumerProfileRef is persisted in storage (a database, for example).

Payment Menu

When Checkin is completed successfully and the consumerProfileRef is secured, the next operation is to display the Payment Menu and have the payer complete a payment, which is visualized in the sequence diagram below.

PayerPayerMerchantMerchantSwedbank PaySwedbank PayPayPOST /psp/paymentorders { consumerProfileRef }rel:view-paymentorderrel:view-paymentorder<script src=rel:view-paymentorder.href />payex.hostedView.paymentMenu()Perform paymentalt[completed payment]onPaymentCompleted(paymentorder)Check payment statusGET paymentorder.idrel:paid-paymentorderGET rel:paid-paymentorder.hrefCompleted Payment OrderShow receipt[failed payment]onPaymentFailed(paymentorder)Check payment statusGET paymentorder.idrel:failed-paymentorderGET rel:failed-paymentorder.hrefFailed Payment OrderShow failure page

Callback

For every change to the Payment Order after its creation, a callback will be made from Swedbank Pay towards the callbackUrl specified in the Payment Order. It is important to listen to these callbacks so in the event that the payer closes the browser window, there are network problems or anything else unexpected happens during the payment process, the status is updated in the merchant system.

MerchantMerchantSwedbank PaySwedbank PayPOST { payment activity }GET paymentorder.idPayment OrderUpdate order status

Capture

After the payment is completed, you can Capture the payment. Capture should be done after the goods are shipped or if the purchased goods don’t require shipping. Only payment instruments that support authorizations will expose the create-paymentorder-capture operation when they can be captured.

MerchantMerchantSwedbank PaySwedbank PayCaptureGET paymentorder.idrel:create-paymentorder-capturePOST rel:create-paymentorder-capture.hrefCapture statusUpdate order status

Supported LanguagesDanish da-DK, English (US) en-US, Finnish fi-FI, Norwegian nb-NO

and Swedish sv-SE.