This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
The project is currently configured for PayPal sandbox testing. The sandbox credentials are already set in .env.
For production deployment, follow these steps:
-
Create PayPal Live App:
- Go to PayPal Developer Dashboard
- Create a new Live App (not sandbox)
- Copy the Client ID and Client Secret
-
Update Environment Variables:
# Production PayPal Credentials PAYPAL_CLIENT_ID=your_live_client_id_here PAYPAL_CLIENT_SECRET=your_live_client_secret_here NEXT_PUBLIC_PAYPAL_CLIENT_ID=your_live_client_id_here # Production Webhook PAYPAL_WEBHOOK_ID=your_live_webhook_id_here # Production URLs NEXT_PUBLIC_SERVER_URL=https://yourdomain.com NEXT_PUBLIC_GRAPHQL_URL=https://yourdomain.com/api/graphql
-
Setup Webhooks:
- In PayPal Developer Dashboard, go to your Live App
- Add webhook URL:
https://yourdomain.com/api/paypal/webhook - Subscribe to events:
PAYMENT.CAPTURE.COMPLETEDCHECKOUT.ORDER.APPROVEDPAYMENT.CAPTURE.DENIEDPAYMENT.CAPTURE.REFUNDED
- Copy the Webhook ID to
PAYPAL_WEBHOOK_ID
-
Deploy:
- Set
NODE_ENV=productionin your deployment environment - The app will automatically use production PayPal APIs
- Set
- Webhook signature verification is mandatory in production
- Never commit real PayPal credentials to version control
- Use environment variables for all sensitive data
- Test thoroughly in sandbox before going live
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.