The id of a PrimerHeadlessUniversalCheckout.VaultedPaymentMethod previously retrieved with fetchVaultedPaymentMethods.
Returns
The deleteVaultedPaymentMethod method performs the deletion operation and returns an error in case of failure, or nil in case of success.
Hide Return Values
Completion will be called when the deletion has been completed.
Error
Hide Errors
PrimerError
An error that will be thrown in case the you provide a vaulted payment method that doesn’t exist.
Example
SWIFT
import UIKitimport PrimerSDKclass MerchantHeadlesVaultManagerViewController: UIViewController { var vaultManager = PrimerHeadlessUniversalCheckout.VaultManager() override func viewDidLoad() { super.viewDidLoad() do { // Before you configure your vault manager you must have started // PrimerHeadlessUniversalCheckout with a client token. try self.vaultManager.configure() } catch { // Handle the error } } func deleteVaultedPaymentMethod(with id: String) { // 👇 Call deleteVaultedPaymentMethod and pass one of the vaulted payment methods' // id (retrieved with fetchVaultedPaymentMethods) self.vaultManager.deleteVaultedPaymentMethod(id: id, completion: { error in if let error = error { // Handle the error } else { // Vaulted payment method was deleted successfully } }) }}