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.
1
async deleteVaultedPaymentMethod(vaultedPaymentMethodId: string): Promise<void>
typescript
copy
Parameters
vaultedPaymentMethodId
StringRequiredThe id
of VaultedPaymentMethod
previously retrieved with fetchVaultedPaymentMethods.
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
.
123456789
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); }}
typescript
copy