|
| 1 | +# React Native Paystack WebView Demo |
| 2 | + |
| 3 | +This is a clean, interactive demo showcasing the React Native Paystack WebView library in action. The demo provides a streamlined payment interface that demonstrates the library's core functionality. |
| 4 | + |
| 5 | +## 🚀 Features |
| 6 | + |
| 7 | +- **Clean UI/UX**: Modern, minimalist design with smooth interactions |
| 8 | +- **Real Paystack Integration**: Uses the actual Paystack WebView library |
| 9 | +- **Form Validation**: Email and amount validation with real-time feedback |
| 10 | +- **Payment Processing**: Simulates the complete payment flow |
| 11 | +- **Mobile Optimized**: Touch-friendly interface with proper keyboard handling |
| 12 | +- **Status Bar Integration**: Proper status bar styling for iOS/Android |
| 13 | + |
| 14 | +## 🎯 Demo Features |
| 15 | + |
| 16 | +### Interactive Payment Flow |
| 17 | + |
| 18 | +- Enter email and amount |
| 19 | +- Real-time form validation |
| 20 | +- Process payment through Paystack WebView |
| 21 | +- Success/error handling with user feedback |
| 22 | +- Clean, intuitive interface |
| 23 | + |
| 24 | +### UI Components |
| 25 | + |
| 26 | +- **Header**: Gradient background with payment info and amount display |
| 27 | +- **Form Inputs**: Email and amount with validation and proper keyboard handling |
| 28 | +- **Payment Button**: Dynamic state with loading indicator |
| 29 | +- **Demo Notice**: Clear indication this is a demo environment |
| 30 | +- **Status Bar**: Light status bar for better visual integration |
| 31 | + |
| 32 | +## 🛠️ Technical Details |
| 33 | + |
| 34 | +### Integration |
| 35 | + |
| 36 | +- Uses `PaystackProvider` from the development library |
| 37 | +- Implements `usePaystack` hook for payment processing |
| 38 | +- Proper TypeScript types and error handling |
| 39 | +- Safe area handling for different device types |
| 40 | + |
| 41 | +### Styling |
| 42 | + |
| 43 | +- Modern color scheme with Paystack branding |
| 44 | +- Smooth animations and transitions |
| 45 | +- Responsive design for different screen sizes |
| 46 | +- Proper spacing and typography |
| 47 | +- Status bar integration |
| 48 | + |
| 49 | +### Validation |
| 50 | + |
| 51 | +- Email format validation |
| 52 | +- Amount validation (positive numbers only) |
| 53 | +- Required field validation |
| 54 | +- Real-time feedback |
| 55 | + |
| 56 | +## 🚀 Running the Demo |
| 57 | + |
| 58 | +1. **Start the development server**: |
| 59 | + |
| 60 | + ```bash |
| 61 | + yarn start |
| 62 | + # or |
| 63 | + npm start |
| 64 | + ``` |
| 65 | + |
| 66 | +2. **Open on your device**: |
| 67 | + |
| 68 | + - Scan the QR code with Expo Go app |
| 69 | + - Or press 'i' for iOS simulator |
| 70 | + - Or press 'a' for Android emulator |
| 71 | + |
| 72 | +3. **Test the payment flow**: |
| 73 | + - Enter a valid email (e.g., `test@example.com`) |
| 74 | + - Enter an amount (e.g., `5000`) |
| 75 | + - Tap "Pay" to initiate payment |
| 76 | + - Experience the WebView integration |
| 77 | + |
| 78 | +## 📱 Demo Screenshots |
| 79 | + |
| 80 | +The demo features: |
| 81 | + |
| 82 | +- Clean, modern interface |
| 83 | +- Intuitive payment flow |
| 84 | +- Real-time validation |
| 85 | +- Professional styling |
| 86 | +- Mobile-optimized design |
| 87 | +- Proper status bar integration |
| 88 | + |
| 89 | +## 🔧 Configuration |
| 90 | + |
| 91 | +### Paystack Setup |
| 92 | + |
| 93 | +The demo uses a test public key. To use your own: |
| 94 | + |
| 95 | +1. Replace the public key in `app/_layout.tsx`: |
| 96 | + |
| 97 | + ```typescript |
| 98 | + publicKey = 'pk_test_YOUR_TEST_KEY_HERE'; |
| 99 | + ``` |
| 100 | + |
| 101 | +2. For production, use your live key: |
| 102 | + ```typescript |
| 103 | + publicKey = 'pk_live_YOUR_LIVE_KEY_HERE'; |
| 104 | + ``` |
| 105 | + |
| 106 | +### Customization |
| 107 | + |
| 108 | +- Modify colors in the component styles |
| 109 | +- Update validation rules |
| 110 | +- Customize success/error messages |
| 111 | +- Adjust status bar styling |
| 112 | + |
| 113 | +## 🎨 Design System |
| 114 | + |
| 115 | +### Colors |
| 116 | + |
| 117 | +- Primary: `#667eea` (Paystack Blue) |
| 118 | +- Background: `#f8fafc` (Light Gray) |
| 119 | +- Text: `#1a202c` (Dark Gray) |
| 120 | +- Input Border: `#e2e8f0` (Light Gray) |
| 121 | +- Success: `#48bb78` (Green) |
| 122 | +- Error: `#f56565` (Red) |
| 123 | + |
| 124 | +### Typography |
| 125 | + |
| 126 | +- Headers: Bold, 24px |
| 127 | +- Body: Regular, 16px |
| 128 | +- Labels: Semi-bold, 16px |
| 129 | +- Amount Display: Bold, 32px |
| 130 | + |
| 131 | +### Spacing |
| 132 | + |
| 133 | +- Consistent 8px grid system |
| 134 | +- Proper padding and margins |
| 135 | +- Touch-friendly button sizes |
| 136 | +- Safe area handling |
| 137 | + |
| 138 | +## 🔒 Security |
| 139 | + |
| 140 | +- SSL encryption notice |
| 141 | +- Secure payment processing |
| 142 | +- No sensitive data stored |
| 143 | +- Demo environment only |
| 144 | + |
| 145 | +## 📄 License |
| 146 | + |
| 147 | +This demo is part of the React Native Paystack WebView project and follows the same MIT license. |
| 148 | + |
| 149 | +## 🤝 Contributing |
| 150 | + |
| 151 | +Feel free to contribute to improve the demo: |
| 152 | + |
| 153 | +1. Fork the repository |
| 154 | +2. Create a feature branch |
| 155 | +3. Make your changes |
| 156 | +4. Submit a pull request |
| 157 | + |
| 158 | +## 🔗 Links |
| 159 | + |
| 160 | +- [Main Library Repository](https://github.com/just1and0/React-Native-Paystack-WebView) |
| 161 | +- [Paystack Documentation](https://paystack.com/docs) |
| 162 | +- [React Native WebView](https://github.com/react-native-webview/react-native-webview) |
| 163 | + |
| 164 | +--- |
| 165 | + |
| 166 | +**Enjoy testing the React Native Paystack WebView library! 🎉** |
0 commit comments