FLUTTER ECOSYSTEM

AhmedAbogameel/paymob_payment

Paymob 支付插件。

paymob_payment 项目封面
Stars
25
Forks
4
最近推送(UTC)
2023年7月8日
项目状态
未归档
Ahmed Abogameel GitHub avatar
GITHUB User

Ahmed Abogameel ↗

Sr. Mobile App Developer

FlashMaadi, Cairo官方网站 ↗
语言C++CMakeDartRubySwiftCKotlinHTMLJavaShellObjective-C

此仓库发布的插件

使用的依赖

依赖清单 5 项

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

paymob_payment

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

Example

:rocket: Installation

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

paymob_payment : latest_version

:hammer: 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 
);

:pushpin: 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, 
);

:bookmark: Usage

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

:incoming_envelope: 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

:test_tube: Testing Cards

:white_check_mark: Successful payment
Variable Description
Card Number 5123456789012346
Expiry Month 12
Expiry Year 30
CVV 123
:negative_squared_cross_mark: Declined payment

Change cvv to 111 or expiry year to 20

:pushpin: Note :

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