Basic payment flow description

Basic payment flow refers to card payment or card storage using the Pia SDK. The SDK offers a view controller for card entry and 3DS authentication unless it has been waived by your chosen card acquirer. This integration guide explains the steps required for a successful card payment and card storage process using the SDK.

Basic Payment flow

3DS Basics If the chosen card acquirer has the 3DS verification required, this process will be triggered in a WebView. In the case 3DS is not required, the transaction is performed directly.

PiA SDK also includes support for Nordea Visa Cards, which have an extra option inside the 3DS process: BankID Verification. If the user chooses the BankID option from the WebView, the BankID application will be opened automatically to confirm the payment. After the BankID authentication is complete, when returning back to the SDK, the web page will detect if the verification was performed and returns a proper result. If the user does not have the BankID app installed on his device, he will be prompted to App store to install it. After that, he can resume the 3DS process.

For a card payment, create a card-payment process providing merchant information (obtained from Netaxept), the amount to be charged (in cents), the currency code and registration callback as shown below:

let merchantDetails = MerchantDetails.merchant(withID: merchantID, inTest: isTestMerchantID)


let cardPayment = PaymentProcess.cardPayment(
    withMerchant: merchantDetails,
    amount: amountInCents,
    currency: currencyCode) { [unowned self] userSelectedToStoreCard, callback in

           // Make the registeration call here and retrun the callback
           registerCardPayment(userSelectedToStoreCard,callback)
     }


Note: If you do not support certain card schemes that are supported by the SDK, pass an exclude-card-scheme set to exclude the card schemes and present user with “This card is not supported” message during card entry.

// Exclude Amex and Visa from supported card scheme list. 
let cardPayment = PaymentProcess.cardPayment(
    withMerchant: merchantDetails,
    excludedCardSchemeSet: [.amex, .visa]
    amount: amountInCents,
    currency: currencyCode) { [unowned self] userSelectedToStoreCard, callback in

           // Make the registeration call here and retrun the callback
           registerCardPayment(userSelectedToStoreCard,callback)
     }

Main card schemes (Visa, MasterCard, Amex, Dankort, Forbrugsforeningen, …)

The SDK offers a declarative API to instantiate a controller for card payment and card storage processes with result callbacks for success, cancellation and failure. Present this controller and handle the callbacks accordingly.


PiaSDK.controller(
    for: cardPayment,
    success: { piaController, transactionId in  },        // Commit the transaction with your merchant backend
    cancellation: { piaController, transactionId in },    // User canceled, rollback the transaction
    failure: { piaController, error in}                   // Rollback transaction, check error object for detail. 
)

Note: See Netaxept documentation for more details on this API.

Note: Netaxept backend integration tips can be found in 5.4 Backend Tips, Register API section