{"id":21056545,"url":"https://github.com/souravray/upi-link","last_synced_at":"2025-05-15T23:33:12.196Z","repository":{"id":57387218,"uuid":"212254362","full_name":"souravray/upi-link","owner":"souravray","description":"Simple npm module to generate UPI deep link as per the UPI Linking Specifications Version 1.5.1","archived":false,"fork":false,"pushed_at":"2019-10-09T08:29:46.000Z","size":14,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T17:05:27.087Z","etag":null,"topics":["deep-linking","payment","upi"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/souravray.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-10-02T04:21:31.000Z","updated_at":"2024-12-14T15:11:08.000Z","dependencies_parsed_at":"2022-09-07T13:20:51.574Z","dependency_job_id":null,"html_url":"https://github.com/souravray/upi-link","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/souravray%2Fupi-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/souravray%2Fupi-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/souravray%2Fupi-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/souravray%2Fupi-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/souravray","download_url":"https://codeload.github.com/souravray/upi-link/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442429,"owners_count":22071864,"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","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":["deep-linking","payment","upi"],"created_at":"2024-11-19T16:51:34.687Z","updated_at":"2025-05-15T23:33:11.830Z","avatar_url":"https://github.com/souravray.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# upi-link \nSimple npm module to generate UPI deep-links, based on UPI Linking Specifications [Version 1.5.1](https://www.npci.org.in/sites/all/themes/npcl/images/PDF/UPI_Linking_Specs_ver_1.5.1.pdf) :money_mouth_face:\n\n## installation\n```\n$ npm i upi-link\n```\n## API\n#### Factory methods\n| Function Name |  Input params | Returns |\n| ------------- |-------------- |---------- |\n| Satic   | VPA ID(M), Payee Name(M), Amount(O)| Builder object |\n| Dynamic | VPA ID(M), Payee Name(M), Amount(M) | Builder object|\n| SaticP   | VPA ID(M), Payee Name(M), Amount(O)| Promise |\n| DynamicP | VPA ID(M), Payee Name(M), Amount(M) | Promise|\n\n#### Setter methods\n1. __setMerchant( mc, ti)__ : Set merchant takes tow parameter _Merchant ID_ (mandatory) and _Transaction ID_ (optional). Both the ID should be generated by the PSP, and should be passed as it is.\n\n2. __setTxRef( refid, note)__ : Set merchant takes tow parameter _Transaction Reference ID_ (mandatory) and _Transaction Note_ (optional). Transaction Reference ID should generated by you. It could be order number, subscription number, Bill ID, booking ID, insurance renewal reference, etc. \n    * ___Note___ : Setting up TxRef is mandatory, when either _Merchant_ is set or the _URL type_ is _Dynamic_\n3. __setMinAmount(amount)__ : Minimum Amount will only be set when _Transaction Amount_ is already set and the _Minimum Amount_ is different from the _Transaction Amount_.\n4. __setCallback(url)__ : This should be a URL when clicked provides customer with further transaction details like complete bill details, bill copy, order copy, ticket details, etc. This can also be used to deliver digital goods.\n    * ___Note___ : Setting up _Callback URL_ doesn't guarantee the it will be called by the PSPs post transaction. Call to this _URL_ is subjected _white listing by the PSPs_.\n\n#### Build Method\n- __getLink()__ : This will return a QR code friendly formated _UPI URI_ string is all conditions are met.\n\n## Chaining\n Build object chaining\n ```js\n const upi = require('upi-link')\n \n let uri = upi.Static(\"xxxxx@ybl\", \"Xyz Abc\")\n .setMerchant(\"ALPHABET\")\n .setTxRef('INV001')\n .getLink()\n \n console.log('URI:  ',uri);\n ```\n \n Promise chaining ___┼___\n ```js\n const upi = require('upi-link')\n \n upi.DynamicP(\"xxxxx@ybl\", \"Xyz Abc\", 100000)\n .setMinAmount(1000)\n .setTxRef('INV001')\n .getLink()\n .then( uri =\u003e console.log('URI:  ',uri))\n .catch( err =\u003e console.error('Error: ',err.message))\n ```\n \n ___┼___ _Promise chaining is the recomended method_. If you are using plain build object you should ___handled errors asseted by each metods___.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsouravray%2Fupi-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsouravray%2Fupi-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsouravray%2Fupi-link/lists"}