|
1 |
| -# Example Stripe Issuing and Treasury integration demonstrating Embedded Finance |
| 1 | +# Stripe Issuing and Treasury: An Embedded Finance Example |
2 | 2 |
|
3 |
| -This demo is an application that allows you to quickly experiment with an Embedded Finance experience using Stripe Issuing & Treasury APIs. |
| 3 | +This demo application enables users to work with an Embedded Finance experience, utilising Stripe's Issuing and Treasury APIs. |
4 | 4 |
|
5 |
| -With this application, you can: |
| 5 | +The application provides the following features: |
6 | 6 |
|
7 |
| -- Sign up for a Stripe [Custom connect](https://stripe.com/docs/connect/custom-accounts) Account and for a Stripe Treasury Financial Account |
8 |
| -- Onboard using [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding) for Custom accounts |
9 |
| -- Display the Financial Account Balance |
10 |
| -- Display a chart to quickly visualize funds coming in and coming out |
11 |
| -- Display a transaction report |
12 |
| -- Create a cardholder and issue a card, using the Financial Account as the source of funds |
13 |
| -- Display the issued card information in a compliant manner by leveraging Stripe Elements |
14 |
| -- Display the Financial Account's Routing and Account numbers |
15 |
| -- Send money from the Financial Account, either using ACH or Wire Transfers |
| 7 | +- Creation of a Stripe [Custom connect](https://stripe.com/docs/connect/custom-accounts) Account and a Stripe Treasury Financial Account. |
| 8 | +- Use of [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding) for Custom accounts setup. |
| 9 | +- Financial Account balance display. |
| 10 | +- Visualisation of incoming and outgoing funds via a chart. |
| 11 | +- Transaction report display. |
| 12 | +- Cardholder creation and card issuing, with the Financial Account serving as the funds source. |
| 13 | +- Compliance-maintained card information display using Stripe Elements. |
| 14 | +- Display of Financial Account's Routing and Account numbers. |
| 15 | +- Money transfer from the Financial Account with ACH or Wire Transfers. |
16 | 16 |
|
17 |
| -In addition to these functions, there is also a *Test Data* section that will help platforms understanding the different mechanisms to fund Financial Accounts by: |
| 17 | +Additionally, a *Test Data* section helps to understand different mechanisms for funding Financial Accounts, by simulating the following: |
18 | 18 |
|
19 |
| -- Simulating receiving a Transfer from an external account to a Financial Account. |
| 19 | +- Transfer reception from an external account to a Financial Account. |
20 | 20 | - Creating a PaymentLink and then, paying out funds from the Connected Account balance to the Financial Account Balance.
|
21 |
| -<!-- You can watch a recorded live stream about this demo [here](https://www.youtube.com/watch?v=2MiMFJ9c4t8). --> |
22 | 21 |
|
23 |
| -## Requirements |
| 22 | +## Prerequisites |
24 | 23 |
|
25 |
| -- **A Stripe account**: You can sign up for a Stripe account here: <https://dashboard.stripe.com/register> |
26 |
| -- **Onboard onto Issuing and Treasury**: |
27 |
| - - Issuing: [Instant Testmode](https://dashboard.stripe.com/setup/issuing/activate) |
28 |
| - - Treasury: [Please contact sales](https://go.stripe.global/treasury-inquiry) |
29 |
| -- **Stripe API keys**: Available in your Stripe dashboard here: <https://dashboard.stripe.com/test/apikeys> |
| 24 | +- **A Stripe account**: Register for a Stripe account here: <https://dashboard.stripe.com/register> |
| 25 | +- **Enable Issuing and Treasury in Stripe**: |
| 26 | + - Issuing: Use [Instant Testmode](https://dashboard.stripe.com/setup/issuing/activate) |
| 27 | + - Treasury: [Contact sales](https://go.stripe.global/treasury-inquiry) |
| 28 | +- **Stripe API keys**: Obtain your keys via <https://dashboard.stripe.com/test/apikeys> |
30 | 29 |
|
31 |
| -## No-code deploy demo to Render.com |
| 30 | +## Deploy demo on Render.com |
32 | 31 |
|
33 |
| -You can deploy this sample app directly to Render.com using the button below. This way you can try it out for yourself |
34 |
| -quickly and without any coding. The button below will create a free database and web service instance. |
| 32 | +To deploy this sample application directly in Render, click on the button below. It automatically logs into Render and |
| 33 | +initiates setup with a free database and web service instance. No coding required. |
35 | 34 |
|
36 | 35 | [](https://render.com/deploy?repo=https://github.com/stripe-samples/issuing-treasury)
|
37 | 36 |
|
38 |
| -When prompted, enter: |
| 37 | +Upon prompt, please provide: |
39 | 38 |
|
40 |
| -* **Blueprint Name**: This can be anything (e.g. "Demo") |
41 |
| -* **Under Key / Value**: |
42 |
| - * **STRIPE_SECRET_KEY**: Your Stripe account's testmode API key |
43 |
| - * **NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY**: Your Stripe account's testmode publishable key |
| 39 | +- **Blueprint Name**: Enter any name (e.g., "Demo") |
| 40 | +- **Under Key / Value**: |
| 41 | + - **STRIPE_SECRET_KEY**: Enter your Stripe testmode API key |
| 42 | + - **NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY**: Enter your Stripe testmode publishable key |
44 | 43 |
|
45 |
| -Once you click "Apply", the infrastructure will begin spinning up. After approximately 5 minutes, click on the link to |
46 |
| -"issuing-treasury" on the page to go to the web service. There, you'll see a link at the top to the URL. It'll look |
47 |
| -something like "https://issuing-treasury-12gj.onrender.com". |
| 44 | +After around 5 minutes, click on the "issuing-treasury" link to access your deployed web service. |
48 | 45 |
|
49 |
| -## Local installation instructions |
| 46 | +## Local Installation |
50 | 47 |
|
51 |
| -### Installing the dependencies |
| 48 | +### Dependency Installation |
52 | 49 |
|
53 |
| -After cloning this repo, install the dependencies. |
| 50 | +Post cloning this repo, install the dependencies using: |
54 | 51 |
|
55 | 52 | npm install
|
56 | 53 |
|
57 |
| -### Populating your .env file |
| 54 | +### .env File Setup |
58 | 55 |
|
59 |
| -Copy the `.env.example` file on the root of your project to `.env`: |
| 56 | +Replicate `.env.example` as `.env` (in project root directory) using: |
60 | 57 |
|
61 | 58 | cp .env.example .env
|
62 | 59 |
|
63 |
| -Edit your new `.env` file and update the required information: |
| 60 | +Update `.env` to reflect: |
64 | 61 |
|
65 |
| -- **STRIPE_SECRET_KEY**: Your Stripe private key. |
66 |
| -- **NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY**: Your Stripe publishable key. |
67 |
| -- **NEXTAUTH_SECRET**: Used to encrypt the NextAuth.js JWT ([learn more](https://next-auth.js.org/configuration/options#nextauth_secret)). You can use `openssl rand -base64 32` to generate a new one. |
68 |
| -- **CONNECT_ONBOARDING_REDIRECT_URL**: The host where your application will run (if local you can use `"http://localhost:3000"`) |
| 62 | +- **STRIPE_SECRET_KEY**: Your Stripe private key |
| 63 | +- **NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY**: Your Stripe publishable key |
| 64 | +- **NEXTAUTH_SECRET**: For JWT encryption by NextAuth.js ([learn more](https://next-auth.js.org/configuration/options#nextauth_secret)). Use `openssl rand -base64 32` to obtain a new one |
| 65 | +- **CONNECT_ONBOARDING_REDIRECT_URL**: Your application host, for local use, use "<http://localhost:3000>" |
69 | 66 |
|
70 |
| -### Setting up the database |
| 67 | +### Database Setup |
71 | 68 |
|
72 |
| -On a Mac, follow these instructions to install Postgres: |
| 69 | +On Mac, follow these instructions to install Postgres: |
73 | 70 |
|
74 | 71 | brew install postgresql@14
|
75 | 72 | createuser -s postgres
|
76 | 73 |
|
77 |
| -You can learn more about the `createuser` step [here](https://stackoverflow.com/a/15309551). |
| 74 | +You'll find more about the `createuser` step [here](https://stackoverflow.com/a/15309551). |
78 | 75 |
|
79 |
| -Now you need to create the database: |
| 76 | +Next, create the database with: |
80 | 77 |
|
81 | 78 | npx prisma db push
|
82 | 79 |
|
83 |
| -If this fails for any reasons such as permissions being denied, there's an included idempotent script you can run: |
| 80 | +If it errors out (perhaps due to permission issues), simply run the included script: |
84 | 81 |
|
85 | 82 | ./db/setup-database.postgres.sh
|
86 | 83 |
|
87 |
| -This will create a `issuing_treasury` database in your local Postgres instance. |
| 84 | +This script creates a local Postgres `issuing_treasury` database. |
88 | 85 |
|
89 |
| -### Running the application |
| 86 | +### Application Launch |
90 | 87 |
|
91 |
| -In order to run the application, after you installed the dependencies and created the `.env` file run the following command: |
| 88 | +After necessary setups, launch the application with `npm run dev`. |
92 | 89 |
|
93 |
| - npm run dev |
| 90 | +*Note: This application serves as an example and should not proceed to production deployment as it is.* |
94 | 91 |
|
95 |
| -*Notice: This application is intended to be an example, and it should not be run in production as is.* |
| 92 | +## Acknowledgment to Devias Theme |
| 93 | + |
| 94 | +The Devias theme significantly contributed to the swift construction of this sample app. Besides providing an elegant display, Devias offers a streamlined integration with Material UI. The effective utilization of this free theme allowed us to deliver a high-quality and engaging sample app. |
| 95 | + |
| 96 | +## Accelerating Development with Devias Pro |
| 97 | + |
| 98 | +Although the free Devias theme was instrumental in building this sample application, for developers who are aiming for a full-featured, production-ready application, we recommend the Devias Pro version. |
| 99 | + |
| 100 | +Devias Pro extends beyond the capacity of the free version, providing an extensive array of advanced components and features designed to expedite and enrich your development process. With Devias Pro, you gain access to additional layouts, advanced React components, and pre-built dashboards, not to mention TypeScript support that underpins clean, robust, and scalable code. |
| 101 | + |
| 102 | +One of the key advantages of Devias Pro is its inclusion of Figma design files. These files empower developers to efficiently build complex user experiences with precision and consistency. The design resources and components available in Devias Pro are patterned after modern UX/UI best practices, providing a smooth, optimized user experience out of the box. |
| 103 | + |
| 104 | +By choosing Devias Pro, you're not just getting a theme; you're getting a robust toolset designed to help you turn your ideas into fully fledged, industrial-strength applications faster. It's a springboard that propels your project from its inception to a production-ready state in less time. |
| 105 | + |
| 106 | +We appreciate the pivotal role Devias themes have played in the development of this sample app, and wholeheartedly recommend a step up to Devias Pro for developers keen on accelerating their development cycles, improving the overall quality of their products, and delivering a top-tier user experience. |
| 107 | + |
| 108 | +You can explore and experience the prodigious benefits of Devias Pro [here](https://material-kit-pro-react.devias.io/). |
0 commit comments