Package selection guidance compiled from public package information, community data, and project usage.
The upi_india package is a Flutter plugin designed for Android that enables seamless UPI (Unified Payments Interface) transactions by integrating with various UPI-enabled apps installed on the device. It allows users to initiate payments directly through popular UPI apps like Google Pay, PhonePe, or Paytm without requiring manual entry of bank details. The plugin simplifies payment processing in Indian e-commerce and service apps by leveraging native UPI functionality. It supports dynamic transaction parameters such as amount, recipient, and transaction reference, ensuring secure and efficient payments. This package is ideal for developers building financial or retail applications targeting the Indian market.
Use cases
Mobile e-commerce checkout
Digital wallet integration
Service payment collection
Bill splitting apps
Donation platforms
Key features
Supports multiple UPI apps
Secure transaction initiation
Dynamic payment parameters
Simple API for Android
Built-in error handling
Suitable for
Indian-focused mobile apps
Payment gateways
Retail and service platforms
Flutter developers on Android
Apps needing UPI payments
Considerations
Android-only support
Requires UPI app installation
Limited to Indian banking system
No iOS compatibility
Depends on user's UPI app availability
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
This repository is now Archived.
UPI India (for Android only)
This plugin is used to integrate UPI Options in your Android app. You can use this plugin to initiate transaction to any UPI ID or to any Account number. Check the Supported apps here.
For a complete example of how to use this plugin, look at the Example tab or in the Github repository.
IMPORTANT!
Some apps like Google Pay, PhonePe, Paytm are currently unable to process the transaction and showing "Maximum limit exceeded" or "Risk threshold exceeded" errors. Reason for this is not clear yet.
Help required
If you can help to extend this for iOS, feel free to check this issue.
If you can help to verify the compatibility of different UPI apps, feel free to check this issue.
Thanks in advance :)
Classes to know
UpiIndia - It is the main class containing two methods:
getAllUpiApps() - It takes:
bool allowNonVerifiedApps: Should include apps whose working has not been verified yet or not
List[UpiApp] includeOnly: List of UpiApps which should be shown and hide the others.
bool mandatoryTransactionId: Should include those apps which doesn't return Transaction ID or not
startTransaction() - It takes:
double amount: Amount to transfer (in ₹)
UpiApp app: Which app to use to do the transaction
String currency: Currently only supports INR
bool flexibleAmount: Set true to allow user to fill the amount
String merchantId: Merchant code if present
String receiverId: ID of the receiver
String receiverName: Name of receiver
String transactionNote: A note about the transaction
String transactionRefId: Reference Id of transaction
String url: For some extra information
UpiApp - It contains supported apps. It is also the model class for the apps returned by getAllUpiApps().
UpiResponse - You will use this to get response from the requested app.
UpiPaymentStatus - Use this to see if transaction was a success or not.
Custom Exception thrown by this Plugin (with self explanatory names)
UpiIndiaAppNotInstalledException
UpiIndiaUserCancelledException
UpiIndiaNullResponseException
UpiIndiaInvalidParametersException
UpiIndiaActivityMissingException
UpiIndiaAppsGetException
How to start transaction?
Step 1:
Import the Package:
import'package:upi_india/upi_india.dart';
Step 2:
Create UpiIndia object.
UpiIndia _upiIndia = UpiIndia();
Step 3:
Get list of all apps in the device which can handle UPI Intent, as shown.