This is a template for Investec card code. This is schaffolding sets up a project with the tools to upload code to the Investec card.
This repository is crafted with ❤️ by our talented community members. It's a space for everyone to use, contribute to, and share. While it aligns with the spirit of our community, please note that this repo is not directly endorsed or supported by Investec. Always exercise caution and discretion when using or contributing to community-driven projects.
Copy over the .env.example file to .env and fill in the required fields.
cp .env.example .envThe .env file is for your local environment and the .env.prod file is for the production environment.
cp .env.example .env.prodTo install the dependencies, run the following command:
npm installYou can access your client id, client secret and api key from the Investec Developer Portal. More information on how to access your keys can be found on the Investec Developer Community Wiki.
To configure the CLI, run the following command:
npx ipb config --client-id <client-id> --client-secret <client-secret> --card-id <card-id>The card id is optional and can be set when calling each command. If you specify a card when calling a command, it will override the card id set in the configuration.
To run the code locally, run the following command:
npx ipb run -f main.js --env prod --amount 60000 --currency ZAR --mcc 0000 --merchant "Test Merchant" --city "Test City" --country ZATo upload code you will need a card key this can be retireved by calling the following command:
npx ipb cardsTo upload code to the card, run the following command by setting the card key, the file and the env to upload: The env is optional and needs the file to be .env.prod if you specify prod
npx ipb deploy -c <cardkey> -f main.js --env prodYou can get your card execution logs with the following command
npx ipb logs -f <filename> -c <cardkey>This project is licensed under the MIT License - see the LICENSE.md file for details