패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.8

flutter_paymob

Paymob를 사용하여 Flutter 앱에서 온라인 카드 및 모바일 지갑을 통해 결제를 쉽게 수락하세요.

AndroidiOSWebmacOSWindows
30일 다운로드
87
좋아요
35
Pub 점수
140

패키지 설치

flutter pub add flutter_paymob

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

flutter_paymob는 Flutter 애플리케이션에 Paymob의 결제 솔루션을 원활하게 통합할 수 있도록 해주는 Flutter 패키지입니다. Android, iOS, Web, macOS, Windows 플랫폼에서 온라인 카드 결제 및 모바일 월렛 거래를 지원합니다. `flutter pub add flutter_paymob`를 통해 간단한 설정으로 개발자는 앱 내에서 안전한 결제 처리를 빠르게 구현할 수 있습니다. 이 패키지는 결제 흐름, 토큰화, 거래 상태 확인을 처리하기 위한 깔끔한 API를 제공하여 사용자에게 체크아웃 경험을 단순화합니다. 전자상거래 앱, 구독 서비스, 그리고 신뢰할 수 있는 다중 플랫폼 결제 기능이 필요한 모든 앱에 적합합니다.

사용 사례

  • 전자상거래 앱
  • 구독 결제
  • 앱 내 구매
  • 디지털 서비스 결제
  • 온라인 티켓팅

주요 기능

  • 카드 및 모바일 월렛을 지원합니다
  • 다중 플랫폼 호환성
  • pub과의 간단한 통합
  • 보안 토큰 처리
  • 실시간 거래 상태
  • 크로스 플랫폼 지원

적합한 대상

  • 모바일 및 웹 전자상거래 앱
  • Paymob를 사용하는 개발자
  • 글로벌 결제 옵션이 필요한 앱
  • 디지털 마켓플레이스를 구축하는 스타트업
  • 빠른 결제 설정이 필요한 프로젝트

고려 사항

  • Paymob 계정 및 API 키가 필요합니다
  • 생산 환경에서는 적절한 오류 처리가 필요합니다
  • Paymob의 백엔드 안정성에 따라 달라집니다
  • 추가적인 UI 사용자 정의가 필요할 수 있습니다
  • Paymob이 지원하는 지역에 한정

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.


🚀 Flutter Paymob — Accept Payments with Zero Hassle

Integrate Paymob card & wallet payments inside your Flutter app with ease. Secure, fast, and ready for production.


📥 Installation

Just add to your pubspec.yaml:

flutter_paymob: ^latest_version

🔧 Setup & Initialization

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());
}

⚡ Quick Usage Guide

Pay with Card 💳
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}");
    }
  },
);
Pay with Wallet 📱
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");
    }
  },
);

💡 Response Object Breakdown

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

🧪 Test Credentials

Type Number / PIN Expiry CVV OTP
Card 5123 4567 8901 2346 12/25 123 -
Wallet 01010101010 - - 123456

🚨 Important Notes

  • Webhook integration is a must! Always verify transactions on your backend with Paymob webhooks to prevent fraud.
  • Customize UI elements (title, appBarColor) to match your brand.
  • Use sandbox keys during development to avoid live charges.
  • Error Handling: Always wrap payment calls with try-catch to gracefully handle network or API failures.
  • Logging: Log transaction attempts and responses for debugging and auditing.
  • Localization: You can customize strings/messages in your app UI to support multiple languages.
  • Security: Never expose your API keys or sensitive info in the client code; keep them safe on the server when possible.

🔄 Handling Payment States

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.


🛠️ Troubleshooting

  • Blank iframe or webview?

    • Check your internet connection.
    • Make sure your iFrame ID and payment tokens are valid and not expired.
    • Verify your Paymob account and integration settings.
  • PlatformException about view creation?

    • Make sure you are using the latest webview_flutter package compatible with your Flutter version.
    • Avoid creating multiple instances of the webview controller simultaneously.
  • Payment not completing or stuck?

    • Confirm your API credentials and integration IDs.
    • Enable verbose logging if available to inspect requests and responses.

🔗 Useful Links


📞 Contact

Need help or want to customize? Reach out to me: Ahmed Hosni - LinkedIn


Happy coding & smooth payments! 🎉


카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.