You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -186,6 +188,184 @@ export default function App() {
186
188
}
187
189
```
188
190
191
+
### Next.js Applications
192
+
193
+
The Flutterwave React SDK works seamlessly with Next.js applications. Since the library loads external scripts, you must ensure it runs only on the client side.
194
+
195
+
#### App Router (Next.js 13+)
196
+
197
+
Add the `'use client'` directive at the top of your payment component:
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
1
+
# Flutterwave React v3 Example
2
2
3
-
## Available Scripts
3
+
This example demonstrates how to integrate Flutterwave payment gateway into your React application using the `flutterwave-react-v3` package.
4
4
5
-
In the project directory, you can run:
5
+
## Features Demonstrated
6
6
7
-
### `yarn start`
7
+
✅ **Three Payment Integration Methods:**
8
+
- Custom button with `useFlutterwave` hook
9
+
- Pre-built `FlutterWaveButton` component
10
+
- Custom styled payment buttons
8
11
9
-
Runs the app in the development mode.<br />
10
-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
12
+
✅ **Real-time Configuration:**
13
+
- Dynamic amount input
14
+
- Customer information management
15
+
- Live payment preview
11
16
12
-
The page will reload if you make edits.<br />
13
-
You will also see any lint errors in the console.
17
+
✅ **Modern UI/UX:**
18
+
- Responsive design
19
+
- Beautiful gradient backgrounds
20
+
- Interactive hover effects
21
+
- Mobile-friendly layout
14
22
15
-
### `yarn test`
23
+
##Getting Started
16
24
17
-
Launches the test runner in the interactive watch mode.<br />
18
-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
25
+
### Prerequisites
19
26
20
-
### `yarn build`
27
+
- Node.js (v14 or higher)
28
+
- npm or yarn
29
+
- Flutterwave account ([Sign up here](https://flutterwave.com))
21
30
22
-
Builds the app for production to the `build` folder.<br />
23
-
It correctly bundles React in production mode and optimizes the build for the best performance.
31
+
### Installation
24
32
25
-
The build is minified and the filenames include the hashes.<br />
26
-
Your app is ready to be deployed!
33
+
1. Install dependencies:
27
34
28
-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
35
+
```bash
36
+
npm install
37
+
# or
38
+
yarn install
39
+
```
29
40
30
-
### `yarn eject`
41
+
2. Update your Flutterwave public key in `src/App.js`:
31
42
32
-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
43
+
```javascript
44
+
constconfig= {
45
+
public_key:"YOUR_FLUTTERWAVE_PUBLIC_KEY", // Replace with your key
46
+
// ... other config
47
+
};
48
+
```
33
49
34
-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
50
+
### Running the Example
35
51
36
-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
52
+
```bash
53
+
npm start
54
+
# or
55
+
yarn start
56
+
```
37
57
38
-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
58
+
Open [http://localhost:3000](http://localhost:3000)to view it in the browser.
39
59
40
-
## Learn More
60
+
## Test Credentials
41
61
42
-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
62
+
For testing purposes, use these Flutterwave test card details:
43
63
44
-
To learn React, check out the [React documentation](https://reactjs.org/).
64
+
-**Card Number:** 5531 8866 5214 2950
65
+
-**CVV:** Any 3 digits
66
+
-**Expiry:** Any future date
67
+
-**PIN:** 3310
68
+
-**OTP:** 12345
45
69
46
-
### Code Splitting
70
+
##Package Information
47
71
48
-
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
72
+
This example uses `flutterwave-react-v3` - the official Flutterwave React package with:
49
73
50
-
### Analyzing the Bundle Size
74
+
- ✅ 100% Test Coverage
75
+
- ✅ TypeScript Support
76
+
- ✅ React 19 Compatible
77
+
- ✅ Multiple Payment Options
78
+
- ✅ Comprehensive Documentation
51
79
52
-
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
0 commit comments