Native android Capacitor Plugins for Ionic.
https://www.npmjs.com/package/upi-intent
npm install upi-intent
import {Upicap} from 'upi-intent';
async pay(){
await Upicap.startPayment({
vpa:'YOUR_UPI_ID',
amount:'10.00',
merchant_code:'UPI_MERCHANT_CODE',
name:'UPI_MERCHANT_NAME',
trans_id:'UNIQE_TRANSCATION_ID'
}).then(res=>{
console.log(res)
alert(JSON.stringify(res))
}).catch(err=>{
console.log(err.message)
})
}
https://www.npci.org.in/what-we-do/rupay/merchant-category-code
interface Result{
status:string,
amount:string,
txnId:string,
txnRef:string,
responseCode:string,
approvalRefNo:string
}
After
.then(res=>{
console.log(res)
alert(JSON.stringify(res))
})
// you can call directly
.then(res=>{
alert(JSON.stringify(res.status))
.......
})
Prop | Type | Value |
---|---|---|
vpa |
string |
upiname@upi |
amount |
string |
10.00 |
name |
string |
UPI account name |
trans_id |
string |
Id should be unique |
merchant_code |
string |
XXXX |