Overview
The Customer Vault allows merchants to store their customer's payment information to the gateway for future use. Once the customer record has been securely added to the Customer Vault, the merchant can then initiate transactions remotely without having to access cardholder information directly. This process is accomplished without the merchant storing the customer's payment information in their local database or payment application.
Adding a Customer to the Customer Vault
Utilizing the Customer vault you may securely store customer's payment information for later use rather then having to repeatedly requesting this information from the customer. In order to perform this with the Payment API you will need to include additional customer vault variable within your payment API requests in order to indicate that you hope to store the payment data into the vault.
customer_vault |
Add/Update a secure Customer Vault record. Values: 'add_customer' , 'update_customer' |
customer_vault_id | Specifies a Customer Vault id. If not set, the payment gateway will randomly generate a Customer Vault id. |
Including the above variable will add the customer payment data to the Vault and return a Customer Vault Id which you may use to refer to the specified vault for later purchases. The Customer Vault Id may also be passed within the request if you would like to set your own vault ids, however, if not passed within the request the API will generate one automatically for the Vault record. Here is an example request of adding a customer to the Customer Vault:
POST /api/transact.php
PARAMS: [ security_key : "Your security(API) key here" customer_vault : add_customer
customer_vault_id : "Optional" ccnumber : "cc_number" ccexp : "cc_exp" ]
You may also utilize the Collect.js payment token to add a customer to the Vault:
POST /api/transact.php
PARAMS: [ security_key : "Your security(API) key here" customer_vault : add_customer
customer_vault_id : "Optional"
payment_token : "Collect.js Payment token here" ]
Once the above requests have been submitted the API response will return the Customer Vault Id and this will be used to refer to the Vault record when updating, deleting or utilizing for payment requests.
Updating the Customer Vault
When a customer wants to change some information within their stored payment data such as address, card number, card expiry, etc. You may utilize the update function within the Customer Vault to update the Vault record. To do so you will need to utilize both theĀ customer_vault
and customer_vault_id
variables. Here is an example where we reference a Vault Id to update a Customer Vault Record:
POST /api/transact.php
PARAMS: [ security_key : "Your security(API) key here" customer_vault : update_customer customer_vault_id : "Customer Vault Id Here" ccnumber : "New cc_number" ccexp : "New cc_exp" ]
Performing a Payment with the Customer Vault
Utilizing the Customer Vault and the Payment API you may also perform transactions. Utilizing the customer_vault_id
variable you are able to call to the stored Customer Vault record and utilize the stored customer's payment data to complete the transaction. Here is an example request using the customer vault to perform a transaction request:
POST /api/transact.php
PARAMS: [ security_key : your_security_key type : sale
amount : 10.00 customer_vault_id : "Customer Vault Id Here" ]
The above example will perform a sales transaction utilizing the specified Customer Vault Id.