Android SDK

Native Android library that reveals and collects card data in sealed views and hosts the Google Pay top-up checkout.

Before You Start

Read the following guides before proceeding:

GuideWhy
PCI Compliant SDKWhat the SDK family covers and which platforms it ships for
AuthenticationHow to mint the user token the SDK authenticates with — see User Token Issuance (Login as User)
Card Top-UpThe estimate and execute calls your backend makes around Collect, 3DS and Wallet
Card DetailsThe confirmation flow that produces the action token Reveal asks for

Overview

com.wirexapp.baas:mobile-sdk is a Kotlin library for View-based Android apps, published to Maven Central. It
draws card values in sealed native views: a revealed card number, a card the user is typing and a wallet
payment token stay inside the SDK and never reach your app code. Your code receives tokens, states and events
only.

The SDK never mints a credential, never stores one and never moves money on its own. Your app supplies a
WirexCredentialProvider the SDK calls on demand; your backend prices and executes every top-up through the
retail API and passes the results in.

SurfaceCredentialsWhat it doesGuide
RevealYesShows the cardholder their own PAN, expiry, CVV and PIN in sealed native rowsReveal Card Details
CollectYesCaptures an external card in a sealed native form and returns a card tokenCollect a Card
3-D SecureNoRenders the issuer challenge returned by a top-up and reports the outcome3DS Challenge
WalletYesEmbeds the Wirex-hosted Google Pay checkout for a top-up your backend pricedGoogle Pay Top-Up

Version. These pages document com.wirexapp.baas:mobile-sdk 0.3.15. The same library backs the
React Native SDK and the Flutter SDK on
Android.


Card Top-Up Flow

sequenceDiagram
    participant User as Cardholder
    participant App as Your App
    participant SDK as Android SDK
    participant Backend as Your Backend
    participant BaaS as Wirex BaaS

    App->>SDK: 1. collect.form(profile TOPUP)
    User->>SDK: 2. type PAN / expiry / CVV / name
    SDK-->>App: 3. onChange (isComplete, brand)
    App->>SDK: 4. tokenizeTopUp (billing details)
    SDK->>BaaS: 5. register card
    SDK-->>App: 6. cardId, brand, bin, last4
    App->>Backend: 7. cardId
    Backend->>BaaS: 8. POST /api/v1/cards/topup/estimate
    Backend->>BaaS: 9. POST /api/v1/cards/topup/execute
    BaaS-->>Backend: three_ds_state.url
    App->>SDK: 10. WirexThreeDS session on the URL
    SDK-->>App: 11. outcome (COMPLETED / PENDING / FAILED / UNKNOWN)
StepActionDescription
1–3WirexCollectFormNative card form. onChange carries completeness and brand, never values
4–6tokenizeTopUpReturns cardId, the only value to store
7–9Top-up estimate and executePass cardId as external_card_id — see Top-Up Transfer
10–11WirexThreeDSRuns the challenge on three_ds_state.url; reconcile the result from the top-up status

Reveal Flow

sequenceDiagram
    participant User as Cardholder
    participant App as Your App
    participant SDK as Android SDK
    participant BaaS as Wirex BaaS

    User->>App: 1. Request card details
    App->>SDK: 2. reveal.session (cardId, fields)
    SDK->>App: 3. actionToken(scope)
    App->>BaaS: 4. POST /api/v1/confirmation/signature/verify
    BaaS-->>App: action_token
    App-->>SDK: action_token
    SDK->>BaaS: 5. POST /api/v1/cards/{cardId}/details, /cvv, /pin
    SDK-->>App: 6. snapshot state Ready
StepActionDescription
1–2session(cardId, fields, cardholderName)One session per open details view
3–4actionToken(scope)Your provider mints a GetCardDetails action token, once per scope per operation
5SDK to WirexResponses are drawn in sealed rows; your code never sees them
6onChangeIdle, Loading, Ready or Failed, with per-field outcomes

Google Pay Top-Up Flow

sequenceDiagram
    participant User as Cardholder
    participant App as Your App
    participant SDK as Android SDK
    participant Backend as Your Backend
    participant BaaS as Wirex BaaS

    App->>Backend: 1. price a top-up
    Backend->>BaaS: POST /api/v1/cards/topup/estimate (google_pay)
    Backend->>BaaS: 2. POST /api/v1/cards/topup/token
    App->>SDK: 3. WirexWalletCheckoutView (quote, providerConfig, auth)
    User->>SDK: 4. confirm in the Google Pay sheet
    SDK->>BaaS: 5. execute the top-up
    SDK-->>App: 6. Executed (id, status)
StepActionDescription
1POST /api/v1/cards/topup/estimatepayment_method is google_pay; returns estimation_id
2POST /api/v1/cards/topup/tokenToken mode only — a short-lived token accepted only by estimate and execute
3WirexWalletCheckoutViewRenders the quote and the Google Pay button
4–6Pay sheet and executeToken mode executes inside the checkout; legacy mode emits a wallet token your backend executes with

Guides

GuideDescription
SDK SetupRequirements, install, environments, credential provider, screen protection
Reveal Card DetailsSessions, field rows, masking, sizing
Collect a CardTop-up and payout card entry, single rows, tokenize results
3DS ChallengeRunning the issuer challenge and telling the endings apart
Google Pay Top-UpCheckout view, token and legacy modes, re-arming, Custom Tab launch
Appearance and StringsWirexAppearance, icons, copy and sizing for every surface
Errors, Logging and TroubleshootingWirexError codes and reasons, logging, timeouts, common failures

SDK Setup has a complete, end-to-end example. Every public type and member is documented. Sources and javadoc jars ship with each version, so Android Studio shows the documentation inline.


Did this page help you?