Table of Contents
Overview
When using the Payment SDK, one valuable capability is the ability to seamlessly integrate customer information into the Customer Vault. This article provides a step-by-step guide on the necessary actions to achieve this integration efficiently.
Required Variables
To successfully add customer card details to the Customer Vault, the crucial step is to incorporate the CustomerVaultCommand
within the parameter set for the startTransaction
call. The CustomerVaultCommand
parameter key accepts two vital values:
-
add-customer
- Adds a new customer record to the Customer Vault associated with the merchant account linked to the processing API key.
- Can be used with the
CustomerVaultId
parameter key to set a custom identifier for the customer. - If the
CustomerVaultID
is not provided, an automatic generation will occur, and the result will be returned in the transaction finished event.
-
update-customer
- Updates the card details of the customer identified with the
CustomerVaultID
parameter key. - Requires the
CustomerVaultID
parameter key for an existing customer record.
- Updates the card details of the customer identified with the
Code Examples
Android
requestParameters.add(ParameterKeys.CustomerVaultCommand, "add-customer");
requestParameters.add(ParameterKeys.CustomerVaultId, "Customer1");
iOS
[request setValue:@"add-customer" forKey:CCParamCustomerVaultCommand];
[request setValue:@"Customer1" forKey:CCParamCustomerVaultId];
These code snippets showcase the incorporation of the CustomerVaultCommand
parameter for adding a customer and setting a custom identifier (Customer1). Ensure that the appropriate value (add-customer
or update-customer
) is selected based on the desired action.
By following these guidelines and incorporating the requisite variables, merchants can seamlessly manage customer information within the Customer Vault using the Payment SDK, enhancing the overall efficiency of transactions.