A comprehensive Flutter plugin for integrating Paymob payment gateway with native Android and iOS SDK support. Accept payments seamlessly and securely in your Flutter applications with full customization support.
- π Easy Integration - Simple API with minimal setup required
- π± Native SDKs - Uses official Paymob Android and iOS SDKs under the hood
- π¨ Customizable UI - Customize button colors, app name, app logo, and more
- π³ Save Card Feature - Optional card saving functionality
- π Secure Payments - Industry-standard security with PCI compliance
- β Type-Safe Results - Strongly typed payment result handling
- π Multi-Currency - Support for multiple currencies (EGP, USD, etc.)
- π Comprehensive Error Handling - Clear error messages and states
- π Null Safety - Fully migrated to null-safe Dart
- π‘οΈ Backend-First Security - Secret key stays on your server; the SDK never touches it
dependencies:
flutter_paymob_sdk:
git:
url: https://github.com/PaymobAccept/flutter_sdk.gitThen run:
flutter pub get
In android/settings.gradle.kts, add the following inside the dependencyResolutionManagement block:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
maven { url = uri("https://storage.googleapis.com/download.flutter.io") }
maven { url = uri("https://jitpack.io") }
val flutterPluginsDeps = file("../.flutter-plugins-dependencies")
if (flutterPluginsDeps.exists()) {
@Suppress("UNCHECKED_CAST")
val json = groovy.json.JsonSlurper().parse(flutterPluginsDeps) as Map<String, Any>
@Suppress("UNCHECKED_CAST")
val androidPlugins = ((json["plugins"] as? Map<String, Any>)?.get("android")
as? List<Map<String, Any>>) ?: emptyList()
androidPlugins.find { it["name"] == "flutter_paymob_sdk" }
?.get("path")
?.let { maven { url = uri("${it}android/libs") } }
}
}
}In android/app/build.gradle.kts, inside the android {} block:
android {
buildFeatures {
dataBinding = true
}
}pod install picks up the bundled PaymobSDK.xcframework automatically.
For full usage examples, API reference, and troubleshooting, see the Example & API Docs.
| Platform | Minimum Version | Status |
|---|---|---|
| Android | API 23 (6.0) | β Supported |
| iOS | 13.0 | β Supported |
- Sign up at Paymob Dashboard
- Get your API keys:
- Public Key:
egy_pk_test_... - Secret Key:
egy_sk_test_...
- Public Key:
- Get Integration ID:
- Go to Settings β Payment Integrations
- Copy your integration ID
Your backend calls the Paymob intention API with the secret key and returns only the publicKey and clientSecret to the Flutter app.
- No real money is charged in test mode
- For testing, use test credentials:
| Type | Number / PIN | Expiry | CVV | OTP |
|---|---|---|---|---|
| Card | 5123 4567 8901 2346 | 12/30 | 123 | - |
| Wallet | 01010101010 | - | - | 123456 |
- Switch to live API keys
- Use live integration IDs
- Complete Paymob verification process
The plugin supports multiple currencies including:
- EGP (Egyptian Pound)
- USD (US Dollar)
- SAR (Saudi Riyal)
- AED (UAE Dirham)
- And more...
Refer back to Paymob documentation for the complete list.
- Bundles Paymob Android SDK 1.8.1 inside the plugin
- Supports Android 6.0 (API 23) and above
- Works with AndroidX
Add the following inside dependencyResolutionManagement.repositories in your android/settings.gradle.kts:
maven { url = uri("https://jitpack.io") }
val flutterPluginsDeps = file("../.flutter-plugins-dependencies")
if (flutterPluginsDeps.exists()) {
@Suppress("UNCHECKED_CAST")
val json = groovy.json.JsonSlurper().parse(flutterPluginsDeps) as Map<String, Any>
@Suppress("UNCHECKED_CAST")
val androidPlugins = ((json["plugins"] as? Map<String, Any>)?.get("android")
as? List<Map<String, Any>>) ?: emptyList()
androidPlugins.find { it["name"] == "flutter_paymob_sdk" }
?.get("path")
?.let { maven { url = uri("${it}android/libs") } }
}- Bundles PaymobSDK.xcframework inside
ios/Frameworks/ - Supports iOS 13.0 and above
- Requires Swift 5.0+
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Documentation: Paymob Developers
- Email: support@paymob.com
- The Flutter team for the amazing framework
- All contributors who help improve this package
See CHANGELOG.md for a list of changes.
Star β this repo if you find it useful!