Delete a vaulted payment method for the customerId attached to the client session by id. You can get the id from any instance of VaultedPaymentMethod returned by fetchVaultedPaymentMethods.

TYPESCRIPT
    async deleteVaultedPaymentMethod(vaultedPaymentMethodId: string): Promise<void>

Parameters

Returns

The deleteVaultedPaymentMethod method performs the deletion of the vaulted payment method and returns a Promise of void.

Example

The VaultManager needs to be configured before deleteVaultedPaymentMethod can be called. Refer to the following example for configuring the VaultManager.

TYPESCRIPT
async function handleDeletePaymentMethod() {
  try {
    //Ensure the Vault Manager has been configured
    await vaultManager.deleteVaultedPaymentMethod("yourVaultedPaymentMethodId");
    console.log("Payment method deleted successfully");
  } catch (error) {
    console.error("Error deleting payment method:", error);
  }
}