Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracking payment status in react native webview

I have a React Native app where i'm using sandbox rest api to complete paypal payment with the help of react-native-webview. This is successfully redirecting me to paypal checkout page and doing the payment. But i need to take user to the previous screen of app after successfull payment. I need to know if the transaction is successfull or not. Can i do that with websocket? If so, how can i do that?

like image 526
Tanmoy Sarker Avatar asked Jun 28 '26 20:06

Tanmoy Sarker


1 Answers

 onNavigationStateChange={(navState) => {
          console.log("navState.url ", navState)

          if (navState.url === "your success url") {
            // navigation.navigate('Home');
           

          } else if (navState.url === 'your cancel url') {
            // navigation.goBack();
          }

        }}
like image 59
shekhar singh Avatar answered Jul 01 '26 12:07

shekhar singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!