This project is a demonstration of how to integrate Stripe Payment Intent API with a Go backend. The project includes a demo frontend with React to initiate the payments and send request to Go API. The purpose of this project is to provide a simple example of how to set up and use Stripe Payment Intent API in a full-stack application.
- Clone the repository:
git clone https://github.com/ojuss/stripe-payment-intent.git
cd stripe-payment-intent/go-backend- Create a
.envfile in thego-backenddirectory and add your Stripe secret key:
STRIPE_KEY=your_stripe_secret_key
PORT=4242- Install dependencies:
go mod tidy- Run the server:
go run server.goThe backend server will start on port 4242.
- Navigate to the
go-frontenddirectory:
cd ../go-frontend- Install dependencies:
npm install- Run the client app:
npm startThe frontend client app will start on port 3000. Go to http://localhost:3000/product to view it.
If you would like to contribute to this project, please fork the repository and submit a pull request. I welcome all contributions, including bug fixes, new features, and documentation improvements.