Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webtaculars/react-native-upi
A react native module for handling payment through UPI
https://github.com/webtaculars/react-native-upi
Last synced: about 2 months ago
JSON representation
A react native module for handling payment through UPI
- Host: GitHub
- URL: https://github.com/webtaculars/react-native-upi
- Owner: webtaculars
- Created: 2018-09-14T13:47:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-12T15:05:35.000Z (about 6 years ago)
- Last Synced: 2024-11-24T00:36:09.539Z (about 2 months ago)
- Language: Java
- Size: 5.86 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-upi
A react native module for handling payment through UPI and handling response from the UPI app.
## Getting started
`$ npm i react-native-upi --save`
`$ react-native link react-native-upi`
## Usage
```javascript
import UPIModule from "react-native-upi";const transactionId = "transactionId";
const message = `message`;
const payTo = "9XXXXXXXXX@upi";
const payName = "Name";
const amount = XXX;UPIModule.openUPIClient(
`upi://pay?pa=${payTo}&pn=${payName}&tr=${transactionId}&tn=${message}&am={amount}`
)
.then(res => {
if (res !== null) {
let result = {};
let response = res.split("&").forEach(property => {
let temp = property.split("=");
result[temp[0]] = temp[1];
});
return result;
}
})
.then(res => {
console.log(res);
});
```### UPI Guidelines
To learn more about deep linking in UPI, checkout [NPCI Guidelines](https://www.npci.org.in/sites/all/themes/npcl/images/PDF/UPI_Linking_Specs_ver_1.5.1.pdf "NPCI Guidelines")