{"id":15555011,"url":"https://github.com/samarthagarwal/flutter_upi","last_synced_at":"2025-10-03T16:41:58.495Z","repository":{"id":56830454,"uuid":"186396755","full_name":"samarthagarwal/flutter_upi","owner":"samarthagarwal","description":"A flutter plugin to invoke UPI apps on the device and returns the response after successful/failed transaction back to app.","archived":false,"fork":false,"pushed_at":"2020-09-30T15:29:54.000Z","size":1219,"stargazers_count":79,"open_issues_count":6,"forks_count":34,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-22T01:43:59.438Z","etag":null,"topics":["android","dart","dartlang","flutter","flutter-package"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samarthagarwal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-13T10:20:00.000Z","updated_at":"2025-03-27T05:15:09.000Z","dependencies_parsed_at":"2022-09-02T05:51:26.293Z","dependency_job_id":null,"html_url":"https://github.com/samarthagarwal/flutter_upi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samarthagarwal/flutter_upi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samarthagarwal%2Fflutter_upi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samarthagarwal%2Fflutter_upi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samarthagarwal%2Fflutter_upi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samarthagarwal%2Fflutter_upi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samarthagarwal","download_url":"https://codeload.github.com/samarthagarwal/flutter_upi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samarthagarwal%2Fflutter_upi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267368932,"owners_count":24076093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dart","dartlang","flutter","flutter-package"],"created_at":"2024-10-02T15:05:38.023Z","updated_at":"2025-10-03T16:41:58.380Z","avatar_url":"https://github.com/samarthagarwal.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlutterUPI Plugin\n\nA flutter plugin to invoke UPI apps on the phone for Android and get the transaction information in response. This plugin supports only Android as of now.\n\n![Demo with the PayTM App](demo.gif)\n\n## Getting Started\n\nSimply import the plugin\n\n```\nimport 'package:flutter_upi/flutter_upi.dart';\n```\n\nAnd then use the `initiateTransaction` method as shown in the code below.\n\n```\nString response = await FlutterUpi.initiateTransaction(\n    app: FlutterUpiApps.PayTM,\n    pa: \"receiver@upi\",\n    pn: \"Receiver Name\",\n    tr: \"UniqueTransactionId\",\n    tn: \"This is a transaction Note\",\n    am: \"5.01\",\n    mc: \"YourMerchantId\", // optional\n    cu: \"INR\",\n    url: \"https://www.google.com\",\n);\n\nprint(response);\n\n```\n\nThe `response` is a `String` that contains all the relevant information. Here is how the String looks like.\n\n```\ntxnId=PTM2008fadf6e7242a4a86d72daef6efa66\u0026responseCode=0\u0026ApprovalRefNo=913338799016\u0026Status=SUCCESS\u0026txnRef=TR1234\n```\nPlease note that some parameters in the response can be undefined when using different apps.\n\n### Parsing the Response\nYou can write your own logic to parse the response string or you can use the `FlutterUpiResponse` class to create a `Map` out of it.\n```\nFlutterUpiResponse flutterUpiResponse = FlutterUpiResponse(response);\nprint(flutterUpiResponse.txnId); // prints transaction id\nprint(flutterUpiResponse.txnRef); //prints transaction ref \nprint(flutterUpiResponse.Status); //prints transaction status\nprint(flutterUpiResponse.approvalRefNo); //prints approval reference number\nprint(flutterUpiResponse.responseCode); //prints the response code\n```\n\n## Supported Apps and Platforms\nAs of now the plugin only supports Android. Since I am not an iOS developer, I have only been able to write the code for Android. If you are interested, feel free to get in touch or create PR if you can do this for iOS as well.\n\nThe plugins supports three apps as of now which I have tested this plugin with. You can use the predefined constants in the `FlutterUpiApps` class and pass it to the `app` named argument in the `initiateTransaction` method.\n\n`FlutterUpiApps.BHIMUPI` will launch the BHIM UPI App \n\n`FlutterUpiApps.GooglePay` will launch the GooglePay App\n\n`FlutterUpiApps.PayTM` will launch the PayTM App\n\n`FlutterUpiApps.PhonePe` will launch the PhonePe App\n\n`FlutterUpiApps.MiPay` will launch the MiPay App\n\n`FlutterUpiApps.AmazonPay` will launch the AmazonPay App\n\n`FlutterUpiApps.TrueCallerUPI` will launch the TrueCallerUPI App\n\n`FlutterUpiApps.MyAirtelUPI` will launch the MyAirtelUPI App\n\n## Error Responses\nThe `response` String can contain any of the following strings as well.\n\n`app_not_installed` : Application not installed.\n\n`invalid_params` : Request parameters are wrong.\n\n`user_canceled` : User canceled the flow.\n\n`null_response` : No data received.\n\n\nYou need to write your own code to handle these responses in your app. Check out the example folder for more implementation details.\n\n### Report any issues if you face any or drop me an email at samarthagarwal@live.com\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamarthagarwal%2Fflutter_upi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamarthagarwal%2Fflutter_upi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamarthagarwal%2Fflutter_upi/lists"}