Skip to content

imriponali/upicap

Repository files navigation

unicap

Native android Capacitor Plugins for Ionic.

Note: Not workig on IOS

This an Example for using Ts Angular Ionic

find more on

https://www.npmjs.com/package/upi-intent

Install via npm

npm install upi-intent

Import in Ionic

import {Upicap} from 'upi-intent';

Use in .ts

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)
})
  }
Find your merchant codes

https://www.npci.org.in/what-we-do/rupay/merchant-category-code

Interfaces

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))
    .......
  })

Transaction

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

About

Native android Capacitor Plugins for Ionic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published