Remove a card
Introduced 1.0.0
Deprecated 1.3.0
Use remove paymentmethod instead.
removeCard
function.info
You need to register a user token to get a successful response.
Removing a card
Parameter | Description |
---|---|
alias | A valid payment card alias from the user wallet. |
receiveOn | The dispatch queue used when invoking the result callback handler. Defaults to main. |
onResult | Result callback handler. |
Please note
SveaWalletClient
is deprecated in version 3.1.0. Use new class SveaAppWallet
instead.
SveaAppWalletSveaWalletClient (deprecated)
let cardAlias = "8f66b624-fb16-11e9-8f0b-362b9e155667"
SveaSveSveaAppWalletaAppWalletallet.shared.removePaymentMethod(withAlias: cardAlias) { [weak self] result in
switch result {
case .success:
print("Card successfully removed!")
case .failure(let error):
print("Card could not be removed, got error: \(error)")
}
}
let cardAlias = "8f66b624-fb16-11e9-8f0b-362b9e155667"
SveaWalletClient.shared.removeCard(withAlias: cardAlias) { [weak self] result in
switch result {
case .onSuccess:
print("Card successfully removed!")
case .onFailure(let error):
print("Card could not be removed, got error: \(error)")
}
}
onSuccess
Returned when the card is successfully removed from the list of available payment methods.
onFailure
Returned when an error occurs. If this happens, the card has not been removed.
Possible errors
case noUserTokenProvided // A user token has not been provided.
case failedToRemoveCard // The chosen card could not be removed.
case unknownError // An unknown error occurred.