end2endpay_flutter_sdk 1.0.3
end2endpay_flutter_sdk: ^1.0.3 copied to clipboard
A Flutter SDK for End2EndPay payment integration with secure WebView support.
End2EndPay Flutter SDK #
A Flutter SDK for integrating End2EndPay payment processing into your Flutter applications. This SDK provides a secure WebView-based payment interface with comprehensive callback support.
Features #
- 🔒 Secure Payment Processing: Uses WebView with security-enhanced settings
- ✅ Input Validation: Comprehensive validation for all payment parameters
- 📱 Cross-Platform: Works on both Android and iOS
- 🎯 Callback Support: Success, error, and cancel callbacks
- 🚀 Easy Integration: Simple API with minimal setup required
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
end2endpay_flutter_sdk: ^1.0.1
Then run:
flutter pub get
Quick Start #
import 'package:flutter/material.dart';
import 'package:end2endpay_flutter_sdk/end2endpay_flutter_sdk.dart';
class PaymentScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Payment')),
body: End2EndPayWebView(
apiKey: 'YOUR_API_KEY',
accessToken: 'YOUR_ACCESS_TOKEN',
amount: 100.00,
currency: 'USD',
reference: 'ORDER-12345',
payerEmail: 'customer@example.com',
onSuccess: (response) {
print('Payment successful: $response');
Navigator.pop(context);
},
onError: (error) {
print('Payment error: $error');
},
onCancel: (message) {
print('Payment cancelled');
Navigator.pop(context);
},
),
);
}
}
Platform Configuration #
Android #
Add to android/app/src/main/AndroidManifest.xml:
<manifest>
<uses-permission android:name="android.permission.INTERNET" />
<application android:usesCleartextTraffic="true">
<!-- Your app content -->
</application>
</manifest>
Update android/app/build.gradle:
android {
defaultConfig {
minSdkVersion 20
}
}
iOS #
Add to ios/Runner/Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>io.flutter.embedded_views_preview</key>
<true/>
Update ios/Podfile:
platform :ios, '12.0'
API Reference #
End2EndPayWebView #
| Property | Type | Required | Description |
|---|---|---|---|
apiKey |
String |
Yes | Your End2EndPay API key |
accessToken |
String |
Yes | Your End2EndPay access token |
amount |
double |
Yes | Payment amount (must be > 0 and <= 999999999.99) |
currency |
String |
Yes | 3-letter currency code (e.g., "USD", "EUR", "GBP") |
reference |
String |
Yes | Unique payment reference (max 255 characters) |
payerEmail |
String |
Yes | Valid email address of the payer |
onSuccess |
Function(String)? |
No | Callback when payment succeeds |
onError |
Function(String)? |
No | Callback when payment fails |
onCancel |
Function(String)? |
No | Callback when payment is cancelled |
License #
This SDK is provided by End2EndPay under the MIT License.# end2endpay_flutter_sdk