Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

10YousefTarek/paymob_payment_plugin

 
 

Repository files navigation

paymob_payment

Easily accept payments through Online Cards in your Flutter app with Paymob.

Example

🚀 Installation

Add this to dependencies in your app's pubspec.yaml

paymob_payment : latest_version

🔨 Initialization

PaymobPayment.instance.initialize(
  apiKey: "", // from dashboard Select Settings -> Account Info -> API Key 
  integrationID: 123456, // from dashboard Select Developers -> Payment Integrations -> Online Card ID 
  iFrameID: 123456, // from paymob Select Developers -> iframes 
);

📌 Note :

You can use this singleton (instance) or Create your own
if you want to create different iFrames or integrations

final PaymobPayment paymobPayment = PaymobPayment();
  paymobPayment.initialize(
  apiKey: "", 
  integrationID: 123456, 
  iFrameID: 123456, 
);

🔖 Usage

final PaymobResponse? response = await PaymobPayment.instance.pay(
  context: context,
  currency: "EGP",
  amountInCents: "20000", // 200 EGP
  onPayment: (response) => setState(() => this.response = response), // Optional
)

📨 PaymobResponse

Variable Type Description
success bool Indicates if the transaction was successful or not
transactionID String? The ID of the transaction
responseCode String? The response code for the transaction
message String? A brief message describing the transaction

🧪 Testing Cards

✅ Successful payment

Variable Description
Card Number 5123456789012346
Expiry Month 12
Expiry Year 30
CVV 123

❎ Declined payment

Change cvv to 111 or expiry year to 20

📌 Note :

May be you have to contact paymob support to activate your test card

About

Paymob payment plugin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 35.2%
  • CMake 30.5%
  • Dart 14.5%
  • Ruby 5.0%
  • Swift 4.7%
  • C 3.8%
  • Other 6.3%