- Include this repository as an npm requirement in the client and server projects for the game.
- In the game frontend code include
src/circle_integration_frontend.js
- This file provides functions for the client to:
- Generate an idempotency key for purchase requests.
- Get circle's public keys for encrypting credit card information.
- Encrypt credit card information using PGP.
- The only calls you need to make here are:
const idempotency_key = circle_integration_frontend.generate_idempotency_key();
returns:
'string'
const encrypted = await circle_integration_frontend.circle_encrypt_card_information(card_number, card_cvv);
returns:
{
circle_encrypted_card_information: 'string',
circle_public_key_id: 'string'
};
- On the game server include
src/circle_integration_client.js
- This file provides function for the client to handle the entire purchase flow, and will expect the idempotency key and the encrypted information provided by the frontend.
- The game server is responsible for authenticating all user requests, and the
user_id
provided to all calls incircle_integration_client.js
are assumed to have been authenticated by the game server already. - See API.md for call information
- On the game server include
src/circle_integration_crm_client.js
- This file provides function for the client to handle the entire administrative purchase management flow, including things like cancelling and refunding purchases, or getting general purchase information
- The CRM server is responsible for only allowing administrators access.
- See API.md for call information