Ranjeet singh
Ranjeet singh

Reputation: 794

How to use sagepay gayteway in react native app?

I want to integrate sagepay gateway in my react native app. I have tried it but can't succeeded. is there any way to use sagepay in my react native app without using I-frame .

Upvotes: 0

Views: 903

Answers (2)

Ranjeet singh
Ranjeet singh

Reputation: 794

I did it using webview.

 return (
      <WebView
        domStorageEnabled={ true }
        javaScriptEnabled={ true }
        source={{uri: url}} />
)

Upvotes: 2

Vishwesh Jainkuniya
Vishwesh Jainkuniya

Reputation: 2839

You can use WebView or CustomTabs (for Android) or SafariView (for iOS).

Then use callbacks methods to handle events. For iOS SafariView will be best option. https://github.com/naoufal/react-native-safari-view

For Android, you need to create some native modules to handle CustomTabs via your JS code.

Now this problem is reduced to same as implementing gateway on website, which is easy enough, most gateway have awesome docs on that.

Basically when user wants to pay then redirect him to WebView, let him to make transaction in the browser, then on gateway callback, take him back to the app.

Upvotes: 1

Related Questions