payhere_mobilesdk_flutter
3.2.3, released 6 months ago by payhere.lk
Accept one-time, subscription, and pre-approval payments through PayHere in Flutter apps.
What it does
Allows Flutter applications to initiate PayHere mobile SDK payments natively without redirecting users to a web browser. Supports one-time payments, recurring subscriptions, pre-approvals, and hold-on-card transactions.
AI-written summary of version 3.2.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to integrate the PayHere payment gateway in a Flutter mobile app.
- You want to process subscriptions or one-time payments natively inside the app.
Skip it when
- You are using a payment gateway other than PayHere.
- You only need web-based checkout integration without native mobile SDK bindings.
Strengths
- Enables in-app payments via PayHere without web browser redirection
- Supports multiple transaction types including subscriptions, tokenization, and holds
- Allows item-wise details for invoices
Weaknesses
- Requires platform-specific configuration on both Android and iOS
- Payment verification requires setting up a separate server endpoint for asynchronous notifications
Setup
- Kind
- Plugin (native code)
- Effort
- High
- Code generation
- No
- Direct dependencies
- 1
Requires adding JitPack Maven repository and ProGuard rules for Android, running pod install for iOS, whitelisting the app package name in the PayHere merchant account, and configuring a backend notification URL.
import 'package:payhere_mobilesdk_flutter/payhere_mobilesdk_flutter.dart';
Map paymentObject = {
"sandbox": true,
"merchant_id": "1211149",
"notify_url": "https://example.com/notify",
"order_id": "ItemNo12345",
"items": "Hello from Flutter!",
"amount": 50.00,
"currency": "LKR",
"first_name": "Saman",
"last_name": "Perera",
"email": "samanp@gmail.com",
"phone": "0771234567",
"address": "No.1, Galle Road",
"city": "Colombo",
"country": "Sri Lanka"
};
PayHere.startPayment(paymentObject, (paymentId) {
print("Success: $paymentId");
}, (error) {
print("Failed: $error");
}, () {
print("Dismissed");
});Alternatives
Packages that do the same job and could replace payhere_mobilesdk_flutter.
- flutter_stripe
Choose this if you are using Stripe instead of PayHere as your payment gateway.
92Compare - in_app_purchase
Choose this if you want to use official Apple App Store and Google Play Store in-app purchases rather than a third-party gateway.
94Compare
Works with
Packages commonly used together with payhere_mobilesdk_flutter: ones it builds on, ones built on it, and its own family.