This guide will help you set up the $5 application fee payment system using Stripe.
- A Stripe account (sign up at https://stripe.com)
- Your React app deployed on Netlify (or another platform that supports serverless functions)
Run the following command to install the new dependencies:
npm install-
Create a Stripe Account
- Go to https://stripe.com and create an account
- Complete the verification process
-
Get Your API Keys
- In your Stripe Dashboard, go to Developers → API keys
- Copy your Publishable key and Secret key
-
Update the Stripe Publishable Key
- Open
src/pages/Apply.js - Replace
'pk_test_your_publishable_key_here'with your actual publishable key - For production, use your live publishable key (starts with
pk_live_)
- Open
Create a .env file in your project root:
REACT_APP_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here- Go to your Netlify dashboard
- Navigate to Site settings → Environment variables
- Add the following variables:
STRIPE_SECRET_KEY= your Stripe secret keyREACT_APP_STRIPE_PUBLISHABLE_KEY= your Stripe publishable key
-
Test Mode
- Use Stripe's test card numbers:
4242 4242 4242 4242(Visa)4000 0000 0000 0002(Visa - declined)
- Use any future expiry date
- Use any 3-digit CVC
- Use Stripe's test card numbers:
-
Test the Flow
- Fill out the payment form
- Complete the payment
- Verify the application form becomes enabled
- Submit the application
-
Switch to Live Mode
- Replace test keys with live keys in your environment variables
- Update the publishable key in
Apply.js
-
Deploy
- Deploy your app to Netlify
- Test with real cards
-
User Flow:
- User visits the Apply page
- Payment form is displayed first
- User enters card details and pays $5
- Upon successful payment, application form becomes enabled
- User completes and submits application
-
Technical Flow:
- Frontend creates payment intent via API call
- Stripe processes the payment
- Payment success enables the form
- Form submission includes payment confirmation
- ✅ PCI compliant (Stripe handles sensitive card data)
- ✅ Secure payment processing
- ✅ Environment variable protection
- ✅ Serverless function isolation
- Update
amount: 500inPaymentForm.js(amount in cents) - Update the display text in
PaymentForm.jsandApply.js - Update the description in the payment intent
- Track successful payments in your form submission
- Store payment intent IDs for reference
- Add payment metadata for reporting
- Modify
PaymentForm.cssfor styling - Add additional payment methods
- Customize error messages
-
Payment Form Not Loading
- Check if Stripe publishable key is correct
- Verify network connectivity
- Check browser console for errors
-
Payment Fails
- Verify Stripe secret key is set correctly
- Check Netlify function logs
- Ensure environment variables are set
-
Form Not Enabling After Payment
- Check payment success callback
- Verify state management
- Check browser console for errors
- Stripe Documentation: https://stripe.com/docs
- Netlify Functions: https://docs.netlify.com/functions/overview/
- React Stripe: https://stripe.com/docs/stripe-js/react
To track your application fee revenue:
-
Stripe Dashboard
- View payments in your Stripe dashboard
- Export payment data for accounting
- Set up webhooks for real-time updates
-
Form Integration
- Payment intent ID is logged to console
- Add to your form submission for tracking
- Store in your database for reporting
- Ensure your terms of service mention the application fee
- Consider refund policies for rejected applications
- Comply with local payment processing regulations
- Include fee disclosure in your application process