A complete payment processing application with React frontend and Laravel backend, featuring subscription management and secure payment processing.
Below is a screenshot of the pricing page interface, showing the bookkeeping services with four distinct pricing tiers:
The application displays a clean, modern pricing page with navigation tabs for "Software Plans", "Bookkeeping Services" (highlighted), and "Bookkeepers & Firms".
The main section features four pricing cards:
- Starter: $299/month for monthly expenses $0 - $15k
- Growth: $449/month for monthly expenses $15k - $50k
- Scaling: $649/month for monthly expenses $50k - $100k
- Enterprise: $899/month for monthly expenses $100k+
Each card includes a "Get Started" button and the page features a detailed comparison table showing features like bookkeeping type, financial packages, and support options across all plans.
- React Frontend: Modern UI with Stripe Elements integration
- Laravel Backend: Secure API endpoints for payment processing
- Pricing Table: Beautiful subscription plans display
- Payment Form: Secure credit card collection with Stripe Elements
- Subscription Management: Create and manage Stripe subscriptions
- User Profile Management: Save and update user information
payment_app/
├── src/ # React frontend source
│ ├── components/ # React components
│ │ ├── PricingTable.tsx
│ │ ├── PaymentForm.tsx
│ │ └── UserProfile.tsx
│ ├── utils/ # Utility functions
│ │ └── userUtils.ts
│ ├── App.tsx
│ ├── global.scss
│ └── index.tsx
├── backends/ # Laravel backend
│ ├── app/
│ │ ├── Http/Controllers/
│ │ │ └── PaymentController.php
│ │ ├── Http/Requests/
│ │ │ ├── PaymentRequest.php
│ │ │ ├── SubscriptionRequest.php
│ │ │ ├── UserCheckRequest.php
│ │ │ └── SubscriptionStatusRequest.php
│ │ └── Models/
│ │ ├── User.php
│ │ └── Subscription.php
│ ├── routes/
│ │ └── api.php
│ └── composer.json
├── package.json
├── public/
│ └── index.html
└── README.md
- Node.js (v16 or higher)
- PHP (v8.1 or higher)
- Composer
- Stripe account with API keys
This project can be run entirely using Docker for easy setup and deployment.
- Docker Desktop installed and running
docker-compose(usually comes with Docker Desktop)
-
Create environment file: Create
docker.envin the root directory:# Frontend Environment Variables REACT_APP_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key_here REACT_APP_API_URL=http://localhost:80 # Backend Environment Variables STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key_here STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key_here # Database Configuration DB_HOST=mysql DB_DATABASE=payment_app DB_USERNAME=root DB_PASSWORD=password DB_PORT=3306
-
Run the project:
chmod +x run-docker.sh ./run-docker.sh
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:80
-
Stop the project:
docker-compose down
-
Install dependencies:
npm install
-
Create environment file: Create a
.envfile in the root directory:REACT_APP_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key_here
-
Start the development server:
npm start
The React app will run on
http://localhost:3000
-
Navigate to backend directory:
cd backends -
Install dependencies:
composer install
-
Create environment file: Copy
.env.exampleto.envand configure:APP_NAME="Payment Application" APP_ENV=local APP_KEY=base64:your_generated_key_here APP_DEBUG=true APP_URL=http://localhost # Stripe Configuration STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key_here STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key_here
-
Generate application key:
php artisan key:generate
-
Start the Laravel server:
php artisan serve
The Laravel API will run on
http://localhost
-
Get your Stripe API keys:
- Go to Stripe Dashboard
- Navigate to Developers > API keys
- Copy your publishable and secret keys
-
Create Price IDs in Stripe: You'll need to create price IDs for each subscription plan:
price_starter- $299/monthprice_growth- $449/monthprice_scaling- $649/monthprice_enterprise- $899/month
-
Update the PaymentForm.tsx: Replace the price IDs in
src/components/PaymentForm.tsxwith your actual Stripe price IDs.
Saves a payment method to Stripe and associates it with a customer.
Request Body:
{
"payment_method_id": "pm_...",
"user_info": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890"
}
}Response:
{
"success": true,
"message": "Payment method saved successfully",
"customer_id": "cus_...",
"payment_method_id": "pm_..."
}Creates a subscription using the saved payment method.
Request Body:
{
"payment_method_id": "pm_...",
"plan_name": "Starter",
"price_id": "price_starter"
}Response:
{
"success": true,
"message": "Subscription created successfully",
"subscription_id": "sub_...",
"subscription_status": "active",
"plan_name": "Starter"
}- Displays subscription plans in a grid layout
- Features comparison table
- Navigation tabs for different service categories
- "Get Started" buttons that navigate to payment form
- Collects user personal information
- Integrates Stripe Elements for secure card input
- Shows order summary
- Handles payment processing and subscription creation
- Displays success/error messages
The app uses a custom CSS theme with:
- Light green accent color (#4ade80)
- Clean, modern design
- Responsive layout
- Custom Stripe Elements styling
- Hover effects and transitions
- Stripe Elements for secure card data collection
- Server-side payment processing
- API key protection (never exposed to frontend)
- Input validation and sanitization
- Error handling and user feedback
Use these Stripe test card numbers:
- Success: 4242 4242 4242 4242
- Decline: 4000 0000 0000 0002
- Requires Authentication: 4000 0025 0000 3155
The app is configured for Stripe test mode by default. For production:
- Replace test keys with live keys
- Update price IDs to live price IDs
- Test the application
- CORS Errors: Ensure the Laravel backend is running on port 80
- Stripe Errors: Verify your API keys are correct and in test mode
- Price ID Errors: Make sure the price IDs in PaymentForm.tsx match your Stripe dashboard
Enable debug mode in Laravel by setting APP_DEBUG=true in your .env file.
For technical support or questions, please contact your system administrator.
Current version: 1.0.0
