Integration options: We advise you to integrate our Mobile SDK Payment Menu instead of integrating card payments directly in your app with WebView.
Card Payments In Mobile Apps
The implementation sequence for Card Payments in mobile apps is identical to the standard Redirect scenario, but also includes explanations of how to include this redirect in mobile apps or in mobile web pages.
How It Looks
You will redirect the payer to Swedbank Pay hosted pages to collect the card information.
Transactions in SEK will have an option for selecting debit or credit card:
API Requests For Payments
The API requests are displayed in the purchase flow.
You can create a card payment
with following operation
options:
Our payment
example below uses the Purchase
value.
Sequence Diagram For Mobile
The sequence diagram below shows a high level description of a complete purchase, and the two requests you have to send to Swedbank Pay. The links will take you directly to the corresponding API description.
When dealing with card payments, 3-D Secure authentication of the cardholder is an essential topic. There are two alternative outcomes of a credit card payment:
- 3-D Secure enabled - by default, 3-D Secure should be enabled, and Swedbank Pay will check if the card is enrolled with 3-D Secure. This depends on the issuer of the card. If the card is not enrolled with 3-D Secure, no authentication of the cardholder is done.
- Card supports 3-D Secure - if the card is enrolled with 3-D Secure, Swedbank Pay will redirect the cardholder to the autentication mechanism that is decided by the issuing bank. Normally this will be done using BankID or Mobile BankID.
sequenceDiagram
participant Payer
participant Merchant
participant SwedbankPay as Swedbank Pay
activate Payer
Payer->>-Merchant: start purchase
activate Merchant
Merchant->>-SwedbankPay: POST /psp/creditcard/payments
activate SwedbankPay
note left of Merchant: First API Request
SwedbankPay-->>-Merchant: payment resource
activate Merchant
Merchant-->>-Payer: authorization page
activate Payer
note left of Payer: redirect to SwedbankPay
Payer->>-Merchant: access merchant page
activate Merchant
Merchant->>-SwedbankPay: GET <payment.id>
activate SwedbankPay
note left of Merchant: Second API request
SwedbankPay-->>-Merchant: rel: redirect-authorization
activate Merchant
Merchant-->>-Payer: display purchase result
sequenceDiagram
participant Payer
participant Merchant
participant SwedbankPay as Swedbank Pay
activate Payer
Payer->>-Merchant: start purchase
activate Payer
Merchant->>-SwedbankPay: POST /psp/creditcard/payments
activate Merchant
note left of Payer: First API request
SwedbankPay-->-Merchant: payment resource
activate SwedbankPay
Merchant-->>-Payer: authorization page
activate Merchant
Payer->>-SwedbankPay: access authorization page
activate Payer
note left of Payer: redirect to SwedbankPay
SwedbankPay-->>-Payer: display purchase information
activate SwedbankPay
Payer->>Payer: input creditcard information
Payer->>-SwedbankPay: submit creditcard information
activate Payer
opt Card supports 3-D Secure
SwedbankPay-->>-Payer: redirect to IssuingBank
activate SwedbankPay
Payer->>IssuingBank: 3-D Secure authentication process
Payer->>-SwedbankPay: access authentication page
activate Payer
end
SwedbankPay-->>-Payer: redirect to merchant
activate SwedbankPay
note left of Payer: redirect back to merchant
Payer->>-Merchant: access merchant page
activate Payer
Merchant->>-SwedbankPay: GET <payment.id>
activate Merchant
note left of Merchant: Second API request
SwedbankPay-->>-Merchant: rel: redirect-authorization
activate SwedbankPay
Merchant-->>Payer: display purchase result
activate Merchant
opt Callback is set
activate SwedbankPay
SwedbankPay->>SwedbankPay: Payment is updated
SwedbankPay->>Merchant: POST Payment Callback
activate SwedbankPay
end