This repository contains a set of example implementations of modern-treasury-js using HTML, CSS, and JavaScript, and a set of API usage examples to demonstrate how to leverage our pre-built UIs to quickly integrate common payments workflows.
This code is intended as an example implementation and should not be used directly in a production environment without thorough review and modification. While this code provides a functional implementation that demonstrates certain concepts or techniques, it may lack important considerations for security, performance, scalability, and reliability.
Note that each API example in this code will retrieve configuration values from environment variables. You can set these variables accordingly to swiftly configure the example and establish a connection to your Modern Treasury organization.
Environment variable | description |
---|---|
MT_ORG_ID | The ID of your Modern Treasury organization |
MT_API_KEY | Your private API key |
MT_PUB_KEY | Your publishable API key |
FS_KEY | Used to encrypt session storage |
Each example in this code is designed to be executed locally.
While running these examples, it is important to modify the code according to your specific requirements for redirection and error handling. However, please note that the example applications were primarily created to demonstrate fundamental API functionalities upon initial execution.
Note: Use this code as a reference or starting point for your own implementation, but exercise caution and diligence when adapting it for production use.
To run this code locally, follow these steps:
- Clone the repository to your local machine.
- Take some time to go through the simple application code to become familiar with it.
- Refer to the startup instructions provided in one of the API usage examples mentioned above to get started.
You can deploy this repository on AWS App Runner by utilizing the provided Python example and configuration file. If you opt for this deployment method, you are welcome to remove the other language backends from your cloned repository. This will streamline your setup and focus solely on the Python implementation.
This repository draws inspiration from Recurly's excellent recurly-integration-examples project.