This is an example e-commerce application that demonstrates how to integrate Finix Payments into a Next.js web application. The example shows two different methods of accepting payments:
- Finix Hosted Checkout - Redirects customers to a secure Finix-hosted checkout page
- Finix Tokenization Form - Embeds the Finix Tokenization Form directly in the website
- Next.js 14 e-commerce example with TypeScript
- Basic UI using Tailwind CSS
- Product catalog with example items
- Shopping cart functionality
- Two payment integration methods
- Simple API example for payment processing
- Clone the repository:
git clone https://github.com/finix-payments/accept-a-payment.git
cd accept-a-payment- Install dependencies:
npm install- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
This method redirects customers to a secure Finix-hosted checkout page. The flow is:
- Customer adds items to cart
- Customer clicks "Checkout with Finix Hosted"
- Customer is redirected to Finix's hosted checkout page
- After payment, customer is redirected back to success/failure page
This method embeds the Finix Tokenization Form directly in the website. The flow is:
- Customer adds items to cart
- Customer clicks "Checkout with Tokenization"
- Customer enters payment details in the embedded form
- Form creates a payment token
- Token is sent to our API to process the payment
- Customer sees success/failure message
For Apple Pay Button, if you want to test this locally, you must use ngrokg to tunnel the local server to a public URL.
brew install ngrok
Make sure you're running the app npm run dev.
Then in a new terminal window ngrok http 3001.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.