Skip to content

Sample application showing an example of how to make initial bulk enrollment of cards to CALM API.

Notifications You must be signed in to change notification settings

vgs-samples/calm-bulk-enrollment

Repository files navigation

VGS Logo

CALM Bulk Enrollment Sample

CircleCI

Environment

Sample is running on Sandbox by default. In order to run on Live environment specify value of live for ENVIRONMENT environment variable.

Enrollment of VGS aliased card data

To send VGS aliases directly to CALM API you need to perform the following steps.

Pre-requisites

  1. In your existing VGS Vault (where you store card data) you need to configure an outbound route for sending data to CALM API. There are two ways to do it:
    1. Go to Vault Dashboard. Select your vault -> Routes -> Add Route (From YAML file) -> Add routes/calm_outbound.yaml route.
    2. Using VGS CLI: vgs apply routes --vault <VAULT_ID> -f routes/calm_outbound.yaml where <VAULT_ID> corresponds to your vault id in which you store card data.
  2. Generate Vault Credentials on Vault Dashboard and save them.
  3. Generate CALM API Credentials and save them.
  4. Run Docker daemon.

Prepare card data

csv/aliased_cards.csv file should contain cardholder name, card number aliases from your existing vault, expiration month and expiration year of the card (you can adjust the sample code to contain billing address too according to our API Reference).

Aliased cards

Testing on sample data

For testing purposes you can use new sandbox vault and redact testing card numbers data. To do it

  • Add alias_inbound.yaml route to your vault following steps in "Pre-requisites" section.
  • Run sample in Docker replacing <VAULT_ID> with your test vault id (or change it in docker-compose.yaml):
    • docker compose build
    • VAULT_ID='<VAULT_ID>' docker compose run alias-test-cards

Perform Bulk Enrollment

To start enrollment process of cards in csv/aliased_cards.csv file use values from "Pre-requisites" step 2 and 3. In command below:

  1. Replace <VAULT_ID> with your test vault id.
  2. Replace <VAULT_USERNAME> and <VAULT_PASSWORD> with your vault username and password from "Pre-requisites" step 2.
  3. Replace <CALM_CLIENT_ID> and <CALM_CLIENT_SECRET> with API credentials client id and secret values from "Pre-requisites" step 3.

Run:

VAULT_ID='<VAULT_ID>' \
VAULT_USERNAME='<VAULT_USERNAME>' \
VAULT_PASSWORD='<VAULT_PASSWORD>' \
CALM_CLIENT_ID='<CALM_CLIENT_ID>' \
CALM_CLIENT_SECRET='<CALM_CLIENT_SECRET>' \
docker compose run bulk-aliases-enrollment

As a result you will get aliased updated cards:

Updated cards

Enrollment of raw card data

Pre-requisites

  1. Create vault on Vault Dashboard.
  2. Use Vault ID to generate CALM API Credentials and save them.
  3. Run Docker daemon.

Prepare card data

Add your card data to csv/card_numbers.csv file according to its format.

Raw cards

Perform Bulk Enrollment

To start enrollment process of cards in csv/card_numbers.csv file use values from "Pre-requisites" step 2 and replace <CALM_CLIENT_ID> and <CALM_CLIENT_SECRET> with API credentials client id and secret values.

Run:

CALM_CLIENT_ID='<CALM_CLIENT_ID>' \
CALM_CLIENT_SECRET='<CALM_CLIENT_SECRET>' \
docker compose run bulk-raw-enrollment

Next Steps

After enrolling your cards, you can get updated cards with synchronous pull or asynchronous push model.

About

Sample application showing an example of how to make initial bulk enrollment of cards to CALM API.

Resources

Stars

Watchers

Forks