Skip to main content
On mobile, opening the payment URL in the system browser pulls the user out of the app and makes the return tricky to handle. A native WebView keeps the user inside the app, lets you automatically detect the end of the payment flow, and triggers verification without any extra action from the user.

Native WebView vs external browser

ApproachAutomatic returnUXRecommended
Native WebViewYes — URL-based detectionSmooth, stays in the app
SFSafariViewController / Chrome Custom TabsPartial — deep link requiredBriefly leaves the appAcceptable
System browserNoLeaves the app
SFSafariViewController (iOS) and Chrome Custom Tabs (Android) do not let you intercept redirects to your return URLs. They are not suitable for this use case without setting up a deep link.

React Native

Dependency: react-native-webview
React Native
Replace https://myapp.com/payment/success and https://myapp.com/payment/cancel with the exact return_url and cancel_url passed at invoice creation.

Flutter

Dependency: webview_flutter
pubspec.yaml
Flutter

iOS (Swift / WKWebView)

iOS (Swift)
Presenting the ViewController:
iOS (Swift)

Android (Kotlin / WebView)

Android (Kotlin)
Starting the Activity and retrieving the result:
Android (Kotlin)
Do not forget to declare PaymentActivity in your AndroidManifest.xml:
AndroidManifest.xml

After return detection

The flow is identical across platforms:
1

Close the WebView

Pop or dismiss the WebView component to go back to the previous screen.
2

Show a verification screen

Display a loading indicator — “Verifying payment…” — while your backend is queried.
3

Call your backend

Your backend calls the confirm endpoint with the token stored at invoice creation.
4

Display the result

Based on the returned status: confirm the order (completed), inform the user (notcompleted), or invite them to wait (pending).
Detecting return_url is a UI signal, not proof of payment. A user can navigate manually to that URL. Always confirm the payment server-side before fulfilling the order.