Skip to content

Examples of integration modern-treasury-js/embedded UIs.

License

Notifications You must be signed in to change notification settings

Modern-Treasury/modern-treasury-integration-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modern Treasury integration examples

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.

Account Collection form example

Payment form example

API usage examples

Configuring the examples

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

How to run

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.

Local

To run this code locally, follow these steps:

  1. Clone the repository to your local machine.
  2. Take some time to go through the simple application code to become familiar with it.
  3. Refer to the startup instructions provided in one of the API usage examples mentioned above to get started.

Deploy to AWS App Runner

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.

Contributing

See CONTRIBUTING file.

License

MIT

Special Thanks

This repository draws inspiration from Recurly's excellent recurly-integration-examples project.