nitish24p / react-native-upi

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

Callbacks for initializePayment are mixed. getting the SUCCESS data inside failureCallback(). #6

Open UnSensei opened 4 years ago

UnSensei commented 4 years ago

The library works fine and does as it advertises, but the returns are mixed. successcallback doesnt return anything.

nitish24p commented 4 years ago

Can you tell me for which case this happens?

UnSensei commented 4 years ago

hey, im not really sure i understood what you meant by which case, but i tried it with google Pay and Amazon Pay, the payments are going through to the right owner, but the transactionID and SUCCESS CASE which are meant to be returned through the successCallback are instead returned in the failureCallback. Medium Article by sombody this is a link to medium page where the author has shown what i mean.

nitish24p commented 4 years ago

Aahh okay got it. will fix this over the weekend

UnSensei commented 4 years ago

@nitish24p Thank you, this will help me clean my code to standard. P.S if you could send reply when u fix it, it'll be very appreciated.

nitish24p commented 4 years ago

Yes was travelling last weekend. was away from work.. will do this

prasanthown commented 4 years ago

i m also faced same problem Fix the response comparison code on

node_modules/react-native-upi-payment/android/src/main/java/com/upi/payment/UpiPaymentModule.java

on line no 89

if (bundle.getString("response") == "SUCCESS") {

Replace with

if (data.getStringExtra("Status").trim().equals("SUCCESS")){

nitish24p commented 4 years ago

@prasanthown can you give a PR.. i'll merge it and push to npm