Prerequisites
Before you begin, ensure you have:- A Busha Business Account and Public API Key (from the Quick Start Tutorial).
- A React Native, iOS, Android, or Flutter mobile application.
Important Note: The mobile SDKs use your Public API Key, not your Secret
API Key. Your Public API Key is automatically generated for your account — you
do not need to create a new token to access it. You can find it in Settings
→ Developer Tools → API Tokens.
Installation
- React Native
- iOS (Swift)
- Android (Kotlin)
- Flutter
@busha/pay-react-native
View the full React Native SDK source, releases, and changelog on GitHub.
react-native/v<version>. You can install directly without going through the npm registry:Initialize the SDK
Initialize once at app startup before any checkout is triggered.- React Native
- iOS (Swift)
- Android (Kotlin)
- Flutter
Wrap your root component with Use
BushaPayProvider. The provider calls BushaPay.init() on mount and auto-detects your app’s bundle ID.environment="live" for production.Launch Checkout
- React Native
- iOS (Swift)
- Android (Kotlin)
- Flutter
Platform Setup
- React Native
- iOS (Swift)
- Android (Kotlin)
- Flutter
Forwarding Deep Link Callbacks
The SDK does not subscribe to incoming URLs itself to avoid conflicts with your existing deep-link setup. Forward Busha callbacks with a single call — it returnstrue if the URL was a Busha callback.
- React Native
- iOS (Swift)
- Android (Kotlin)
- Flutter
Pick whichever matches the deep-link approach your app already uses.Option A — React Native Linking:Option B — expo-linking:Option C — React Navigation:
You can verify your deep link setup without making a real payment.iOS simulator:Android emulator:Replace
com.example.myapp with your actual bundle ID or application ID.How It Works
Whencheckout() is called, the SDK opens a chooser with two options:
- Pay with Busha app — if the Busha app is installed on the device, the SDK deep-links directly into it. The user completes the payment inside the Busha app and is returned to your app via the callback URL scheme. If the Busha app is not installed, the SDK falls back to the web checkout automatically.
- Pay with Stablecoins — opens the Busha web checkout in an in-app WebView (WKWebView on iOS, WebView on Android). The user completes the payment inside your app without switching to another application.
checkout().
When payment completes via the web checkout, the result includes full payment data — amounts, currencies, exchange rate, and timeline. When payment completes via the Busha app, only paymentId and status are available. Use result.hasFullData to check before accessing the additional fields.
Payment Results
All four SDKs return the same three result types:Cancellation Reasons
Acancelled result carries a reason so you can tell exactly how the checkout ended:
When payment completes via the Busha app, only
paymentId and status are
available. Full payment data (amounts, currencies, rate, timeline) is only
returned when payment completes via the web checkout. Use result.hasFullData
to check. Always verify payments server-side via webhooks — the client result
is a UX hint, not the source of truth.Checkout Configuration
Restricting Payment Methods
By default, checkout shows a chooser with two options: Pay with Busha app and Pay with Stablecoins. PassallowedPaymentMethods to skip the chooser or restrict options:
Troubleshooting
CHECKOUT_IN_PROGRESS— A previouscheckout()call hasn’t resolved yet. Wait for it to complete before calling again.WEBVIEW_LOAD_ERROR— Network failure or DNS error. Check the device’s internet connection.WEBVIEW_HTTP_ERROR— The checkout endpoint returned a non-2xx HTTP response. Check your public key and environment configuration.WEBVIEW_TIMEOUT— Checkout page didn’t load within 30 seconds. Retry on a stable connection.HTML_LOAD_ERROR(iOS, Android, and Flutter only) — The bundled checkout HTML asset failed to load. Try reinstalling the SDK.WEBVIEW_PROCESS_TERMINATED(Android only) — The WebView renderer process was killed by the system. Retry the checkout.BUSHA_APP_LAUNCH_FAILED— The SDK could not deep-link into the Busha app. On iOS verifyLSApplicationQueriesSchemesis configured correctly in yourInfo.plist. On Android verify the<queries>block is present in your manifest.401 Unauthorized— Double-check that your public API key is correct and matches your environment (sandbox vs live).- Callback not received after Busha app payment — Your deep link setup is incomplete. Test it manually using the
xcrun simctloradbcommands in the note above.