deleteToken()
deleteToken() deletes a token and its corresponding ciphertext from the token vault.
!!! note
This method is overloaded to handle string and string arrays, and to account for the optional customData parameter.
Syntax
public void deleteToken (string token, string table)
public void deleteToken (string[] tokens, string table)
Note
If your application calls insert(), get(), deleteToken(), or deleteValue() within a loop, make sure that it starts the token service outside of the loop. See Sample: Starting the Token Service Outside of the Loop.
Request Parameters
Parameters | Data Types | Descriptions |
---|---|---|
token | string or string[] | A token value that corresponds to an encrypted value, or an array of tokens. |
table | string | This is the Token Vault name and it must be in CAPITAL LETTERS. |
Exception
Passes an exception if:
A table is missing.
A token is null or invalid.
The token and customData arrays do not have the same number of elements.
A customData element is too long.
Example
deleteToken("5541997351273456", "CREDIT_CARD_NUMBERS")
The method creates the SQL statement, which deletes the appropriate row from the token vault, and then executes the SQL statement.