Credit Card Tokenizer Server
The server side component of the cc-tokenizer.
Install with Npm/Yarn
npm install --global @brad-jones/cc-tokenizer-server
yarn global add @brad-jones/cc-tokenizer-server
Configure the environment
The server use environment variables for configuration.
- NODE_ENV: Set this
developmentwhen testing and debugging.
- CC_TOKENIZER_HOST: Set this to an ip addresses that the server will listen on, you may use
0.0.0.0to attach to all interfaces.
- CC_TOKENIZER_PORT: Set this to a port number that the server will listen on, something like port
- CC_TOKENIZER_TOKEN_RECEIVER: Set this to a URL that will be called when a new token is created. See the token receiver section below for more info.
- CC_TOKENIZER_BPOINT_ENDPOINT: The base url for the Bpoint API, defaults to
- CC_TOKENIZER_BPOINT_MERCHANTNO: A Bpoint Merchant Number.
- CC_TOKENIZER_BPOINT_USERNAME: A Bpoint Username.
- CC_TOKENIZER_BPOINT_PASSWORD: A Bpoint Password.
- CC_TOKENIZER_EWAY_ENDPOINT: The base url for the Eway API, defaults to
- CC_TOKENIZER_EWAY_USERNAME: A eWay Username.
- CC_TOKENIZER_EWAY_PASSWORD: A eWay Password.
Then just run
cc-tokenizer-server, which should be on your
$PATH after doing a global install of the package.
NOTE: Alternative Install Method
Instead of installing the package globally, you could install it into a local node.js project. And then create a
.envfile with the above configuration.
The Token Receiver
This package is all well and good, it can create new credit card tokens for you. However it obviously does not understand how / where you would like to store your new credit card tokens.
The token receiver is a fully qualified URL that will be "POSTed" to every time a new token is created.
The payload that your reciever endpoint will get, looks like:
Now you can store the
token against the
customerRef in your database.
resultTokenis an intermediate token and is only included for "completeness" sake. Maybe it might be useful in debugging / logging.