flutter_paymob
Paymob를 사용하여 Flutter 앱에서 온라인 카드 및 모바일 지갑을 통해 결제를 쉽게 수락하세요.
ahmedhosni803/flutter_paymob open-source repository details.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Integrate Paymob card & wallet payments inside your Flutter app with ease. Secure, fast, and ready for production.
Just add to your pubspec.yaml:
flutter_paymob: ^latest_version
Before your app runs, initialize:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await FlutterPaymob.instance.initialize(
apiKey: "YOUR_PAYMOB_API_KEY",
integrationID: 123456, // Card integration ID
walletIntegrationId: 654321, // Wallet integration ID
iFrameID: 789012, // Paymob iframe ID
);
runApp(const MyApp());
}
await FlutterPaymob.instance.payWithCard(
title: Text("Card Payment"), // Optional - Custom title AppBar
appBarColor: Colors.blueAccent, // Optional - Custom AppBar color
context: context,
currency: "EGP",
amount: 150,
onPayment: (response) {
if (response.success) {
print("🎉 Payment Success! TxID: ${response.transactionID}");
} else {
print("❌ Payment Failed: ${response.message}");
}
},
);
await FlutterPaymob.instance.payWithWallet(
title: Text("Card Payment"), // Optional - Custom title AppBar
appBarColor: Colors.blueAccent, // Optional - Custom AppBar color
context: context,
currency: "EGP",
amount: 150,
number: "01010101010",
onPayment: (response) {
if (response.success) {
print("🎉 Wallet Payment Successful");
} else {
print("❌ Wallet Payment Failed");
}
},
);
| Field | Type | Meaning |
|---|---|---|
| success | bool | Was the payment successful? |
| transactionID | String? | Unique ID for the transaction |
| responseCode | String? | Numeric response from Paymob API |
| message | String? | Description / message from Paymob |
| Type | Number / PIN | Expiry | CVV | OTP |
|---|---|---|---|---|
| Card | 5123 4567 8901 2346 | 12/25 | 123 | - |
| Wallet | 01010101010 | - | - | 123456 |
title, appBarColor) to match your brand.The onPayment callback triggers on success, failure, or cancellation.
Use the response.success boolean and response.message to determine the payment state and update your UI accordingly.
Blank iframe or webview?
PlatformException about view creation?
webview_flutter package compatible with your Flutter version.Payment not completing or stuck?
Need help or want to customize? Reach out to me: Ahmed Hosni - LinkedIn
의존성 목록 5 개
{"sdk":"flutter"}^1.5.0^6.1.5{"sdk":"flutter"}^2.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗