Skip to content
Last updated

Redirect Checkout — Mobile Implementation

On mobile, opening the Banxa checkout in an external browser is the simplest integration path. It avoids all WebView configuration complexity and is compatible with all payment methods.


Android

Use Custom Chrome Tabs to open the checkout URL. This provides a browser-quality experience while keeping the customer in your app's task stack.

Do not use a standard WebView for redirect checkout on Android. WebView has known issues with Google Pay (GPAY) and ACH bank transfers.

Implementation

// Kotlin
import androidx.browser.customtabs.CustomTabsIntent

fun openBanxaCheckout(context: Context, checkoutUrl: String) {
    val customTabsIntent = CustomTabsIntent.Builder()
        .setShowTitle(true)
        .build()
    customTabsIntent.launchUrl(context, Uri.parse(checkoutUrl))
}
// Java
CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
    .setShowTitle(true)
    .build();
customTabsIntent.launchUrl(context, Uri.parse(checkoutUrl));

Add the dependency to your build.gradle:

implementation 'androidx.browser:browser:1.5.0'

iOS

Use SFSafariViewController to open the checkout URL. This gives customers a full Safari experience (including saved passwords and Apple Pay) while staying within your app.

// Swift
import SafariServices

func openBanxaCheckout(url: URL) {
    let safariVC = SFSafariViewController(url: url)
    present(safariVC, animated: true)
}

Note: KYC liveness checks (Sumsub) require SFSafariViewController or the system Safari browser. They will not work in a standard WKWebView.


React Native

Use the react-native-inappbrowser-reborn package or Linking to open the checkout URL in the device browser or an in-app browser view.

import { Linking } from 'react-native';
// or
import InAppBrowser from 'react-native-inappbrowser-reborn';

async function openBanxaCheckout(checkoutUrl) {
  if (await InAppBrowser.isAvailable()) {
    await InAppBrowser.open(checkoutUrl, {
      // iOS
      dismissButtonStyle: 'cancel',
      preferredBarTintColor: '#000000',
      // Android
      showTitle: true,
      enableUrlBarHiding: true,
    });
  } else {
    Linking.openURL(checkoutUrl);
  }
}

Flutter

Use the url_launcher package to open the checkout URL in a Custom Tab (Android) or SFSafariViewController (iOS).

import 'package:url_launcher/url_launcher.dart';

Future<void> openBanxaCheckout(String checkoutUrl) async {
  final uri = Uri.parse(checkoutUrl);
  if (await canLaunchUrl(uri)) {
    await launchUrl(
      uri,
      mode: LaunchMode.externalApplication, // opens Custom Tab / SFSafariVC
    );
  }
}

Add the dependency to pubspec.yaml:

dependencies:
  url_launcher: ^6.1.0

Handling the return

When checkout is complete, Banxa redirects to your redirectUrl. Handle this using your platform's deep link or URL scheme handling, then look up the order status via webhook or the order lookup endpoint.