Pay with Invoice
Important
Introduced in Android version 2.6.0 and iOS version 3.4.0
getBankIdUrlForPayment
method, providing a payment token.After obtaining this URL, the app should use it to create an intent and launch the BankId App.
The staging environment can be configured to return URLs launching either bankID-sandbox or a web interface mocking the bankId responses.
The URLs are constructed in a way so that you should not need to process it before launching an app request on your platform.
getPaymentResponse
in order to obtain the payment status.

Get BankId Url
Provides a valid BankId token for this payment.
Parameter | Description |
---|---|
paymentToken | A payment token provider by the partner's backend |
redirectUrl | A valid URL for returning to the application. |
receiveOn | The dispatch queue used when invoking the result callback handler. Defaults to main. |
onResult | Result callback handler. |
SveaAppWallet.shared.getBankIdUrlForPayment(paymentToken: paymentToken, redirectUrl: URL) { [weak self] result in
switch result {
case .success(let bankIdUrl):
// Using this bankId URL open BankId if installed.
UIApplication.shared.open(bankIdUrl. options: [:], completionHandler: nil])
case .failure(let error):
print("Could not get bankId url, got error \(error)")
}
}
onSuccess
Returned when a BankId token is successfully generated.
onFailure
Returned when an error occurs.
Possible errors
case noPaymentTokenProvided // No payment token was found
case failedToGetBankIdUrl //The bankId url could not be fetched
Get payment response
Returns the status of an invoice payment.
Parameter | Description |
---|---|
onResult | Result callback handler. |
onSuccess
Returned when a BankId payment is successfully completed.
onFailure
Returned when an error occurs.
Possible errors
case failedToPay // Failed to pay using invoice.
case failedToConfirmPayment // Failed to get payment status