This project integrates the Vesta anti-fraud solution into a Next.js application. It includes dynamic script loading for Vesta's JS library and API's.
- Proof of Concept: Demonstrates the practical implementation of Vesta into an e-commerce transaction flow.
- Comprehensive Code Examples: Includes all necessary code to implement Vesta's anti-fraud features.
- Dynamic Script Loading: For Vesta's JS library, enabling dynamic interaction with the Vesta service.
- Custom Hooks & Components: Manage Vesta transactions, cart updates, and final evaluations.
- Clone the repository.
- Run
npm install
to install dependencies. - Set up your
.env.local
file with the required Vesta credentials. - Run
npm run dev
to start the development server.
The application consists of several components that interact with the Vesta service:
<AccessTokenFetcher />
- Fetches and stores the access token.<Initiate />
- Initiates a transaction with Vesta.<AddCart />
- Adds items to the cart for the transaction.<PageChange />
- Handles page change events and displays transaction status.<Finalize />
- Finalizes the transaction.<Evaluate />
- Evaluates and concludes the transaction process.
Contributions are welcome. Please submit a pull request or open an issue for any bugs or feature requests.