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

CapabilityDetail
Card-on-file checkoutCustomer pays with a card linked to their Scan to Pay profile (registered on first use; reused on every subsequent purchase)
In-flow card registrationFirst-time customers register their card inside the SDK — no separate sign-up flow
AMT and 3DS authenticationThe SDK handles PIN or 3D Secure challenges natively — no WebView code on your side
Pay-by-AppOptional deep-link flow that hands off to a bank's mobile app (ABSA, Standard Bank, Capitec, etc.)
Pay-by-Card buttonsPre-built buttons you drop into your layout — no custom UI required
Card managementCustomers add / remove cards from their profile inside your app
Pre-registrationOptional 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?

PathBest forSection
Lib Lite SDK (this section)Native apps that want zero payment UI workThis section
Bluebox hosted checkoutWeb flows where users can be redirected to a checkout pageE-commerce hosted checkout
E-commerce custom checkoutWeb or app where you want full control of the checkout UXE-commerce custom checkout
App-to-app deep linkingRouting payments to bank apps rather than processing in-appApp-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:

  1. A live or sandbox merchant account — onboarded via the Portal or the Merchant Onboarding API
  2. A Lib Lite API token — generated in the Portal: log in → Email dropdownLib Lite TokensGenerate
  3. A backend that can create codes — typically a POST /code call. See Managing QR codes for the API.
  4. 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 with CODE_NOT_VARIABLE_AMOUNT. Set the amount when you create the code on your backend.


Platform requirements

PlatformMinimumRecommended
AndroidAPI 21 (Lollipop, 5.0)API 28+ (Android 9+)
iOSiOS 12iOS 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

PageWhat it covers
SDK downloadsWhere to get the AAR (Android) and the XCFramework (iOS)
Android — OverviewWhat's in the Android SDK
Android — InstallationGradle setup, manifest, dependencies
Android — PaymentsThe payment intent — inputs, outputs, result codes
Android — Pay-by-App buttonDrop-in button + deep-link handoff to bank apps
Android — Pay-by-Card buttonDrop-in button for the SDK card-checkout flow
Android — Manage CardStandalone card-management flow without a purchase
Android — Pre-registrationOptional pre-register flow for faster first checkout
Android — Loading dialogThe supplied progress UI
Android — ErrorsResult-code reference
Android — ChangelogVersion history
iOS — OverviewWhat's in Scan to PayKit
iOS — InstallationFramework embed, Info.plist
iOS — PaymentsThe checkout method, parameters, delegate callbacks
iOS — Pay-by-App buttonMPPayByApp view + bank-app handoff
iOS — Pay-by-Card buttonDrop-in MPPayByCard view
iOS — Manage CardCard-management invocation
iOS — Pre-registrationPre-register method
iOS — Loading dialogThe supplied loading dialog
iOS — ErrorsMPError enum reference
iOS — ChangelogVersion history

What's next