nitish24p / react-native-upi

A tiny module for Adding payments via UPI in your react native apps ❤️
MIT License
77 stars 30 forks source link

Payment is declined #35

Open vishnusai14 opened 2 years ago

vishnusai14 commented 2 years ago

Whenever i try to do a payment with google pay it throws me an error saying payment is declined

Code : import React from "react"; import { View, Button, Alert } from "react-native"; import RNUpiPayment from "react-native-upi-payment"; class App extends React.Component { render() { function floo() { RNUpiPayment.initializePayment( { vpa: "xxx@upiid", //your upi address like 12345464896@okhdfcbank payeeName: "xxx", // payee name amount: "1", //amount transactionNote: "Testing Upi", //note of transaction transactionRef: "aasf-332-aoei-fn", //some refs to aknowledge the transaction }, successCallback, failureCallback ); } function failureCallback(data) { console.log(data); } function successCallback(data) { console.log(data); } return (

Kumar2106 commented 2 years ago

We are team of developer from Azu startup company and we are trying to use this module but it is giving us something like this. We are unable to figure it out the issue. Can you please help us out.

nitish24p commented 2 years ago

Can you please format the code a bit better, and provide an example where the issue is reproducible

vishnusai14 commented 2 years ago
import React from 'react';
import {View, Button, Alert} from 'react-native';
import RNUpiPayment from 'react-native-upi-payment';
class App extends React.Component {
  successCallback = data => {
    console.log(data);
  };
  failureCallback(data) {
    Alert.alert('Payment Fail');
    console.log(data);
  }

  init = () => {
    RNUpiPayment.initializePayment(
      {
        vpa: xxx@okicici', //your upi address like 12345464896@okhdfcbank
        payeeName: 'Google Pay Merchant', // payee name
        amount: '1', //amount
        transactionNote: 'Testing Upi', //note of transaction
        merchantCode: '',
        transactionRef: '4567887656-312-acoe-fn', //some refs to aknowledge the transaction
      },
      this.successCallback,
      this.failureCallback,
    );
  };
  render() {
    return (
      <View>
        <Button
          title="Pay Now"
          onPress={() => {
            this.init();
          }}
        />
      </View>
    );
  }
}

export default App;

How to Reproduce:

Note The same Error can be reproducible using the example code given in the github

nitish24p commented 2 years ago

Please can you check what versions you are running are you able to go to the intent selection screen, or you get the error on pressing pay now button. I did a fresh install was able to open intent selection screen.

vishnusai14 commented 2 years ago

I can able to open the intent selection screen and i am selecting google pay it shows the upi details as well as the amount after clicking the pay button in google pay it shows Payment declined

nitish24p commented 2 years ago

The upi id that you entered.. is it a merchant ID Or a personal id?

vishnusai14 commented 2 years ago

The Upi id is the business upi id only

nitish24p commented 2 years ago

From what i read last Business UPI ids for need to be signed by a public key key only then the payment works.. Can you try with you above code sending the payment to a friend, i.e a non business upi

vishnusai14 commented 2 years ago

Sending to personal UPI ID is not working I will try the former one

heyakhil commented 2 years ago

Screenshot_2022-02-04-21-35-26-650_com phonepe app

See this error is coming Vpa is merchant upi id then also And it is not blocked then why it is coming

vishnusai14 commented 2 years ago

Yes, I have signed the upi id also and add the signature as parameter but still the payment failed

Kumar2106 commented 2 years ago

Screenshot_2022-02-04-21-35-26-650_com phonepe app

See this error is coming Vpa is merchant upi id then also And it is not blocked then why it is coming

@vishnusai14 i guess this is the same issue that we got for our app.

vishnusai14 commented 2 years ago

Yes This is the same issue. Everything payment is declined with all the upi apps

I have used the business upi id and even signed it

manish-ironman commented 2 years ago

Please help me how to fix that problem @nitish24p

knmn2000 commented 2 years ago

I've been trying to send money to my own paytm wallet, and I get an error every time I try. Tried UPI IDs of my bank accounts as well. nothing seems to work. I've tried using different apps as methods to make the payments, but that doesnt help either. Please help

nitish24p commented 2 years ago

I havent had time to look at this issue, if its a pressing issue you can fork this repo and see if you're able to debug the issue / give a PR for it. Thanks

nisdecoder commented 2 years ago

Yes, I have signed the upi id also and add the signature as parameter but still the payment failed

What process you have followed to generate signature? what libraries you have used for generating signature? react-native-sha256 and react-native-base64?

CreateStack commented 2 years ago

From what i read last Business UPI ids for need to be signed by a public key key only then the payment works.. Can you try with you above code sending the payment to a friend, i.e a non business upi

How to sign an UPI ID? Please help, new to this.

@nitish24p

CreateStack commented 2 years ago

Yes This is the same issue. Everything payment is declined with all the upi apps

I have used the business upi id and even signed it

How do we sign an UPI ID? @vishnusai14 Please help

pratteekshaurya1994 commented 1 year ago

@nitish24p were you able to solve this issue? because this issue is still coming

manish0707 commented 12 months ago

Facing same issue

MrAbhishekSingh commented 6 months ago

I already have a MERCHANT UPI ID, but I'm facing the same issue with several other MERCHANT UPI IDs I've tried. Can you suggest a UPI that might work