Flutter SDK

Flutter package that reveals and collects card data in native views and hosts the Apple Pay and 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

wirex_mobile_sdk is one pub.dev package for Flutter apps. It renders card values in native platform views
on iOS and Android: a revealed card number, a card the user is typing and a wallet payment token stay on the
native side and never cross into Dart. Your Dart 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
credential provider 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 Apple Pay / Google Pay checkout for a top-up your backend pricedApple Pay and Google Pay Top-Up

Version. These pages document wirex_mobile_sdk 0.3.15. The package installs the native SDKs at its
own version: the WirexMobileSDK pod on iOS and com.wirexapp.baas:mobile-sdk on Android.

Same native SDK as React Native. The React Native SDK wraps the same
native SDKs with the same surfaces, environments and credential model. Only the Dart API differs.


Card Top-Up Flow

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

    App->>SDK: 1. WirexCollectFormView (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–3WirexCollectFormViewNative 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 Mobile SDK
    participant BaaS as Wirex BaaS

    User->>App: 1. Request card details
    App->>SDK: 2. WirexReveal.instance.createSession (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–2createSessionOne session per open details view
3–4actionTokenYour provider mints a GetCardDetails action token
5SDK to WirexResponses are drawn in native rows; Dart never sees them
6onSnapshotidle, loading, ready or error, with per-field outcomes

Wallet Top-Up Flow

sequenceDiagram
    participant User as Cardholder
    participant App as Your App
    participant SDK as Mobile 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 (apple_pay / google_pay)
    Backend->>BaaS: 2. POST /api/v1/cards/topup/token
    App->>SDK: 3. WirexWalletCheckoutView (quote, providerConfig, auth)
    User->>SDK: 4. confirm in the Pay sheet
    SDK->>BaaS: 5. execute the top-up
    SDK-->>App: 6. WirexWalletCheckoutExecuted (id, status)
StepActionDescription
1POST /api/v1/cards/topup/estimatepayment_method is apple_pay or 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 wallet 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
Reveal Card DetailsSessions, field rows, masking
Collect a CardTop-up and payout card entry, custom layouts, tokenize results
3DS ChallengeRunning the issuer challenge and telling the endings apart
Apple Pay and Google Pay Top-UpCheckout view, token and legacy modes, re-arming, Custom Tab launch
Appearance and StringsTheme tokens, icons, copy and sizing for every surface
Errors, Logging and TroubleshootingError types per surface, logging, timeouts, common failures

SDK Setup has a complete, end-to-end example. Every public type and member is documented in the package's API reference on pub.dev.


Did this page help you?