1

In react native app I am trying to use one-react-native-upi so that user can pay using UPI app. Below is how I am trying to use

const onSucess = () => {
  console.log('Success:');
};

const onFailure = (e: any) => {
  console.log('Failure:', e);
};

const payNow = () => {
  OneUpi.initiate(
    {
      upiId: 'xxxx@upiID',
      name: 'xxxx',
      note: 'Deposit',
      amount: '10',
      targetPackage: 'com.google.android.apps.nbu.paisa.user',
    },
    onSucess, //<--Error: Argument of type '() => void' is not assignable to parameter of type '() => success'.  Type 'void' is not assignable to type 'success'.ts(2345)
    onFailure,
  );
};

In above code I am getting error. I am not sure how to fix it, and also when payNow is called I am getting failure response:

Failure: {"message": "No Action Taken", "status": "FAILED"}

I am stuck on this since last few days, and not sure how to fix the issues

pratteek shaurya
  • 850
  • 2
  • 12
  • 34
  • Are you testing with ios, it only supports android according to the [github page](https://github.com/devsonuyadav/one-react-native-upi). – Nils Kähler Jun 19 '23 at 18:11
  • The error suggests that your onSuccess handler is supposed to return something. – Evert Jun 19 '23 at 18:40

0 Answers0