In-App Payments
Embed Scan to Pay's hosted checkout inside your mobile app — Android and iOS SDKs (Lib Lite) for accepting card-on-file payments without writing any payment UI.
Lib Lite is the Scan to Pay in-app payment SDK. It gives mobile-app developers a turnkey checkout experience: a single SDK call brings up the Scan to Pay payment flow, the customer pays with a card on file (or registers a new one), and the SDK returns control to your app with a transaction reference.
If you've built an e-commerce or services app and want to accept card payments without writing your own checkout UI or going through PCI scope, Lib Lite is the right choice. If you want to build your own UI against the platform, use E-commerce custom checkout or Bluebox hosted checkout instead.
This section covers both platforms — Android and iOS — and walks through the SDK from installation to handling the payment response.
What Lib Lite does
| Capability | Detail |
|---|---|
| Card-on-file checkout | Customer pays with a card linked to their Scan to Pay profile (registered on first use; reused on every subsequent purchase) |
| In-flow card registration | First-time customers register their card inside the SDK — no separate sign-up flow |
| AMT and 3DS authentication | The SDK handles PIN or 3D Secure challenges natively — no WebView code on your side |
| Pay-by-App | Optional deep-link flow that hands off to a bank's mobile app (ABSA, Standard Bank, Capitec, etc.) |
| Pay-by-Card buttons | Pre-built buttons you drop into your layout — no custom UI required |
| Card management | Customers add / remove cards from their profile inside your app |
| Pre-registration | Optional flow that registers a card before the first purchase, for a faster first checkout |
You provide:
- A transaction code (created server-side via the Codes API)
- An API key (issued in the Portal under Lib Lite Tokens)
- One SDK invocation in your activity / view controller
You get back:
- A success / failure / cancelled callback
- A transaction reference you verify server-side
Architecture at a glance
Your app Your backend Scan to Pay
──────── ──────────── ───────────
│ │ │
│ create order │ │
├───────────────────────► │ │
│ │ │
│ │ /code (create) │
│ ├─────────────────────► │
│ │ ◄─────────────────────┤
│ │ { code: "1234567890" }
│ │ │
│ ◄───────────────────── ┤ │
│ code + apiKey │ │
│ │ │
│ launch Lib Lite │ │
│ Intent / Scan to PayKit │ │
│ ────────────────────────────────────────────► │
│ │ │
│ user pays inside the SDK (card + PIN/3DS) │
│ ◄────────────────────────────────────────── │
│ │ │
│ result + txReference │ │
│ │ │
│ POST result + ref │ │
├───────────────────────► │ │
│ │ webhook for ref │
│ │ ◄────────────────────┤
│ │ or /transactionState/{id}
│ ├─────────────────────► │
│ │ │
│ │ verify before fulfilling order
Critical: Never trust the SDK's success callback as authoritative. Always confirm via webhook or /transactionState on your backend before shipping goods or releasing services.
Which path is right for you?
| Path | Best for | Section |
|---|---|---|
| Lib Lite SDK (this section) | Native apps that want zero payment UI work | This section |
| Bluebox hosted checkout | Web flows where users can be redirected to a checkout page | E-commerce hosted checkout |
| E-commerce custom checkout | Web or app where you want full control of the checkout UX | E-commerce custom checkout |
| App-to-app deep linking | Routing payments to bank apps rather than processing in-app | App-to-app |
You can use Lib Lite alongside any of the above — for example, an in-app Lib Lite primary flow with an Pay-by-App fallback to launch a banking app.
Prerequisites
Before you start the SDK integration:
- A live or sandbox merchant account — onboarded via the Portal or the Merchant Onboarding API
- A Lib Lite API token — generated in the Portal: log in → Email dropdown → Lib Lite Tokens → Generate
- A backend that can create codes — typically a
POST /codecall. See Managing QR codes for the API. - Webhook or polling integration — to confirm the transaction. See Webhooks or Querying transactions.
Codes must be fixed-amount for Lib Lite. Variable-amount codes are rejected by the SDK withCODE_NOT_VARIABLE_AMOUNT. Set the amount when you create the code on your backend.
Platform requirements
| Platform | Minimum | Recommended |
|---|---|---|
| Android | API 21 (Lollipop, 5.0) | API 28+ (Android 9+) |
| iOS | iOS 12 | iOS 14+ |
Lib Lite uses the device camera (for QR scanning at registration), location (for fraud screening), and SMS reader (Android-only, for OTP retrieval). Permissions are requested by the SDK as needed — your app doesn't have to pre-declare them all, but you should be aware they'll appear.
Section structure
| Page | What it covers |
|---|---|
| SDK downloads | Where to get the AAR (Android) and the XCFramework (iOS) |
| Android — Overview | What's in the Android SDK |
| Android — Installation | Gradle setup, manifest, dependencies |
| Android — Payments | The payment intent — inputs, outputs, result codes |
| Android — Pay-by-App button | Drop-in button + deep-link handoff to bank apps |
| Android — Pay-by-Card button | Drop-in button for the SDK card-checkout flow |
| Android — Manage Card | Standalone card-management flow without a purchase |
| Android — Pre-registration | Optional pre-register flow for faster first checkout |
| Android — Loading dialog | The supplied progress UI |
| Android — Errors | Result-code reference |
| Android — Changelog | Version history |
| iOS — Overview | What's in Scan to PayKit |
| iOS — Installation | Framework embed, Info.plist |
| iOS — Payments | The checkout method, parameters, delegate callbacks |
| iOS — Pay-by-App button | MPPayByApp view + bank-app handoff |
| iOS — Pay-by-Card button | Drop-in MPPayByCard view |
| iOS — Manage Card | Card-management invocation |
| iOS — Pre-registration | Pre-register method |
| iOS — Loading dialog | The supplied loading dialog |
| iOS — Errors | MPError enum reference |
| iOS — Changelog | Version history |
What's next
- Get the SDK → SDK downloads
- Start an Android integration → Android — Overview
- Start an iOS integration → iOS — Overview
- How to create codes for the SDK → Managing QR codes
- Confirm payment server-side → Webhooks or Querying transactions
Updated 2 days ago
