I use Stripe Checkout in a WebView
in Flutter.
During the payment flow using Ideal (Netherlands based banking system) the flow tries to open an external app and sends a URL like the following:
nl.abnamro.ideal://%7B%22idealTransaction%22...
this is the WebView relevant code:
WebView(
initialUrl: initialUrl,
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (controller) => _controller = controller,
navigationDelegate: (NavigationRequest request) async {
if (request.url.startsWith('https://example.com/succes')) {
...
Navigator.pop(context, status); // <-- Handle success case
} else if (request.url.startsWith('https://example.com/cancel')) {
Navigator.pop(context, Status.paymentCanceled); // <-- Handle cancel case
}
if (request.url.startsWith("https") || request.url.startsWith("http")) {
return NavigationDecision.navigate;
}
_launchURL(request.url);
return NavigationDecision.prevent;
})
the _launcURL
method is
_launchURL(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}}
and what I get in output is
Could not launch nl.abnamro.ideal://%7B%22idealTransaction%22%3A%7B%22i...
and my flow gets stuck.
This deep link should open the ABN Amro app, which is installed on my device. This actually works on iOS.
Do you know what is the best way to deal with this flow?