react-native-upi icon indicating copy to clipboard operation
react-native-upi copied to clipboard

Payment is declined

Open vishnusai14 opened this issue 3 years ago • 22 comments

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 ( <View> <Button title="Pay Now" onPress={() => { floo(); }} /> </View> ); } }

export default App;

In the console it prints {STATUS : "FAILURE"}

I am using business UPI ID Only

vishnusai14 avatar Jan 29 '22 07:01 vishnusai14

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.

Kumar2106 avatar Jan 29 '22 09:01 Kumar2106

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

nitish24p avatar Jan 30 '22 20:01 nitish24p

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:

  • Install expo-cli using npm install -g expo-cli
  • Initialize a project using expo init AwesomeProject and move inside the project
  • Eject the project using expo eject
  • Copy and paste this code in App.js
  • Run npx react-native run-android

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

vishnusai14 avatar Jan 31 '22 03:01 vishnusai14

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.

nitish24p avatar Jan 31 '22 21:01 nitish24p

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

vishnusai14 avatar Feb 01 '22 10:02 vishnusai14

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

nitish24p avatar Feb 01 '22 16:02 nitish24p

The Upi id is the business upi id only

vishnusai14 avatar Feb 02 '22 04:02 vishnusai14

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

nitish24p avatar Feb 02 '22 15:02 nitish24p

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

vishnusai14 avatar Feb 03 '22 02:02 vishnusai14

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

heyakhil avatar Feb 04 '22 16:02 heyakhil

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

vishnusai14 avatar Feb 05 '22 04:02 vishnusai14

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.

Kumar2106 avatar Feb 06 '22 05:02 Kumar2106

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

vishnusai14 avatar Feb 06 '22 06:02 vishnusai14

Please help me how to fix that problem @nitish24p

manish-ironman avatar Feb 20 '22 16:02 manish-ironman

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

knmn2000 avatar Feb 28 '22 18:02 knmn2000

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

nitish24p avatar Mar 03 '22 21:03 nitish24p

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?

nisdecoder avatar Apr 04 '22 09:04 nisdecoder

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 avatar Apr 05 '22 07:04 CreateStack

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

CreateStack avatar Apr 05 '22 07:04 CreateStack

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

pratteekshaurya1994 avatar Jun 18 '23 17:06 pratteekshaurya1994

Facing same issue

manish0707 avatar Nov 26 '23 18:11 manish0707

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

MrAbhishekSingh avatar May 14 '24 14:05 MrAbhishekSingh