FLUTTER ECOSYSTEM

arshmancodes/paymob_pakistan

一個用於 Flutter 的外掛程式,可透過 Paymob 巴基斯坦輕鬆在您的 Flutter 應用中接受 Jazzcash/Easypaisa/信用卡付款。

paymob_pakistan 專案封面
Stars
17
Forks
3
最近推送(UTC)
2024年1月24日
專案狀態
未封存
Arshman Afzal GitHub avatar
GITHUB User

Arshman Afzal ↗

Flutter | NodeJs | Express.js | Firebase | Socket.io | MVVM | MongoDB | MySQL

Lahore, Pakistan
語言C++CMakeDartRubySwiftCKotlinHTMLJavaShellObjective-C

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 5 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

paymob_pakistan

Easily accept Jazzcash/Easypaisa/Card Payments through Paymob Pakistan in your Flutter app.

:rocket: Installation

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

paymob_pakistan : latest_version

:hammer: Initialization

PaymobPakistan.instance.initialize(
  apiKey: "", // from dashboard Select Settings -> Account Info -> API Key 
  jazzcashIntegrationId: 123123, // From Dashboard select Developers -> Payment Integrations -> JazzCash Integration ID
  easypaisaIntegrationID: 123123,  // From Dashboard select Developers -> Payment Integrations -> EasyPaisa Integration ID
  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 PaymobPakistan paymobPakistan = PaymobPakistan();
  paymobPakistan.initialize(
  apiKey: "", 
  jazzcashIntegrationId: 123123, 
  easypaisaIntegrationID: 123123,  
  integrationID: 123456, 
  iFrameID: 123456, 
);

:bookmark: Usage

final PaymobResponse? response = await PaymobPakistan.instance.pay(
  context: context,
  currency: "PKR",
  paymentType: PaymentType.card, // or you can User paymentType: PaymentType.jazzcash OR PaymentType.easypaisa
  amountInCents: "50000", // 500 PKR
  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 25
CVV 123
Name Test Account
:negative_squared_cross_mark: Declined payment

Change cvv to 111 or expiry year to 20

Credits

All API Credits goes to Paymob Pakistan

:pushpin: Note :

Visit Paymob Pakistan to get your PayMob account for accepting Digital Payments on your Flutter Application. May be you have to contact paymob support to activate your test card