使用PayMob付款
pay_with_paymob 是一個 Flutter 套件,旨在為 Visa 和行動錢包交易提供無縫的 Paymob 支付整合。此套件提供了一種簡單且高效的方式來處理支付流程,讓開發者更容易在其應用程式中實現支付功能。
- 星標
- 10
- 分支
- 3
- 最近推送(UTC)
- 2024年11月19日
- 專案狀態
- 未封存
原始 README
以下為英文專案原文快照,最新內容請造訪 GitHub。
pay_with_paymob
A Flutter package to simplify Paymob gateway integration for Visa and mobile wallet payments.
Features
<<<<<<< HEAD
- Easy integration with Paymob's payment system.
- Support for multiple payment methods: Visa and mobile wallets.
- Customizable payment view with flexible style options.
- User data collection for enhanced payment experiences.
- Callbacks for handling payment success and errors.
=======
pay_with_paymob
A Flutter package that simplifies the integration of Paymob gateway for Visa and mobile wallet payments.
f590b71af9211ba066d7a7ebe79821eab643a677
Getting Started
Prerequisites
- Flutter SDK installed on your machine.
- A Paymob account to acquire the API key and other necessary credentials.
Installation
Add the following line to your pubspec.yaml file:
dependencies:
pay_with_paymob: ^1.3.4
Run flutter pub get to install the package.
<<<<<<< HEAD
=======
dependencies:
pay_with_paymob : ^1.1.2
f590b71af9211ba066d7a7ebe79821eab643a677
Usage
Initializing Payment Data
Before proceeding with payment, initialize your payment data (in the main function or the initState of your widget):
PaymentData.initialize(
apiKey: "Your API Key", // Required: Obtain from dashboard -> Settings -> Account Info -> API Key
iframeId: "Your Iframe ID", // Required: Obtain from Developers -> iframes
integrationCardId: "Your Card Integration ID", // Required: Obtain from Developers -> Payment Integrations -> Online Card ID
integrationMobileWalletId: "Your Wallet Integration ID", // Required: Obtain from Developers -> Payment Integrations -> Mobile Wallet ID
// Optional User Data
userData: UserData(
email: "User Email", // Optional: Default is 'NA'
phone: "User Phone", // Optional: Default is 'NA'
firstName: "User First Name", // Optional: Default is 'NA'
lastName: "User Last Name", // Optional: Default is 'NA'
),
// Optional Style Customizations
style: Style(
primaryColor: Colors.blue, // Default: Colors.blue
scaffoldColor: Colors.white, // Default: Colors.white
appBarBackgroundColor: Colors.blue, // Default: Colors.blue
appBarForegroundColor: Colors.white, // Default: Colors.white
textStyle: TextStyle(), // Default: TextStyle()
buttonStyle: ElevatedButton.styleFrom(), // Default: ElevatedButton.styleFrom()
circleProgressColor: Colors.blue, // Default: Colors.blue
unselectedColor: Colors.grey, // Default: Colors.grey
showMobileWalletIcons: true, // Default: true
),
);
Navigating to the Payment View
Once initialized, navigate to the payment view using:
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PaymentView(
onPaymentSuccess: () {
// Handle successful payment
},
onPaymentError: () {
// Handle payment error
},
price: 100, // Required: Total price, e.g., 100 means 100 EGP
),
),
);
Additional Information
Test Data for Simulation
Visa Card:
- Card Number: 5123456789012346
- Card Holder Name: Test Account
- Expiry Date: 12/25
- CVV: 123
<<<<<<< HEAD Mobile Wallet:
- Wallet Number: 01010101010
- MPIN: 123456
- One-Time Password: 123456
For further details, refer to the documentation.
Contributions
We welcome contributions! If you encounter issues or have suggestions, feel free to open an issue on GitHub.
تأكد من تحديث أي روابط أو معلومات تتعلق بالحزمة حسب الحاجة. إذا كان لديك أي تعديلات أو إضافات أخرى، لا تتردد في إخباري!
f590b71af9211ba066d7a7ebe79821eab643a677
使用的依賴
依賴清單 5 項
- dio
^5.7.0 - flutter
{"sdk":"flutter"} - webview_flutter
^4.9.0 - flutter_test開發依賴
{"sdk":"flutter"} - flutter_lints開發依賴
^4.0.0
如何選擇適合專案的儲存庫?
先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
- 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
- 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
- 使用前在 GitHub 確認 README、授權條款與 Issues。
來源與維護
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗