This is a clean, interactive example showcasing the React Native Paystack WebView library in action. The example provides a streamlined payment interface that demonstrates the library's core functionality.
- Clean UI/UX: Modern, minimalist design with smooth interactions
- Real Paystack Integration: Uses the actual Paystack WebView library
- Form Validation: Email and amount validation with real-time feedback
- Payment Processing: Simulates the complete payment flow
- Mobile Optimized: Touch-friendly interface with proper keyboard handling
- Status Bar Integration: Proper status bar styling for iOS/Android
- Enter email and amount
- Real-time form validation
- Process payment through Paystack WebView
- Success/error handling with user feedback
- Clean, intuitive interface
- Header: Gradient background with payment info and amount display
- Form Inputs: Email and amount with validation and proper keyboard handling
- Payment Button: Dynamic state with loading indicator
- Example Notice: Clear indication this is a example environment
- Status Bar: Light status bar for better visual integration
- Uses
PaystackProviderfrom the development library - Implements
usePaystackhook for payment processing - Proper TypeScript types and error handling
- Safe area handling for different device types
- Modern color scheme with Paystack branding
- Smooth animations and transitions
- Responsive design for different screen sizes
- Proper spacing and typography
- Status bar integration
- Email format validation
- Amount validation (positive numbers only)
- Required field validation
- Real-time feedback
-
Start the development server:
yarn start # or npm start -
Open on your device:
- Scan the QR code with Expo Go app
- Or press 'i' for iOS simulator
- Or press 'a' for Android emulator
-
Test the payment flow:
- Enter a valid email (e.g.,
test@example.com) - Enter an amount (e.g.,
5000) - Tap "Pay" to initiate payment
- Experience the WebView integration
- Enter a valid email (e.g.,
🎥 Watch the example video on Imgur
The example uses a test public key. To use your own:
-
Replace the public key in
app/_layout.tsx:publicKey = 'pk_test_YOUR_TEST_KEY_HERE';
-
For production, use your live key:
publicKey = 'pk_live_YOUR_LIVE_KEY_HERE';
- Modify colors in the component styles
- Update validation rules
- Customize success/error messages
- Adjust status bar styling
- Primary:
#667eea(Paystack Blue) - Background:
#f8fafc(Light Gray) - Text:
#1a202c(Dark Gray) - Input Border:
#e2e8f0(Light Gray) - Success:
#48bb78(Green) - Error:
#f56565(Red)
- Headers: Bold, 24px
- Body: Regular, 16px
- Labels: Semi-bold, 16px
- Amount Display: Bold, 32px
- Consistent 8px grid system
- Proper padding and margins
- Touch-friendly button sizes
- Safe area handling
- SSL encryption notice
- Secure payment processing
- No sensitive data stored
- Example environment only
This example is part of the React Native Paystack WebView project and follows the same MIT license.
Enjoy testing the React Native Paystack WebView library! 🎉