coinflow_card_form is a Flutter SDK that embeds Coinflow’s card tokenization form directly into iOS and Android apps from a single Dart codebase. The user enters their card inside your app, the SDK returns a payment token, and your backend charges the card via the standard Coinflow checkout API.
coinflow_card_form0.2.0minSdk 24+Or in pubspec.yaml:
Drop CoinflowCardFormWidget into your widget tree and pass a CoinflowCardFormController you’ll use to trigger tokenization.
your-merchant-id is an example placeholder. Use your actual merchant ID from the merchant dashboard, or contact the Coinflow integrations team. Typically injected with --dart-define=COINFLOW_MERCHANT_ID=..., not hard-coded.
Call controller.tokenize() only after the form has loaded. Either pass an onLoad callback or check controller.isLoaded before invoking:
Invoking tokenize() earlier throws CoinflowException('Card form not yet loaded'). Concurrent calls also throw — only one tokenize can be in flight at a time.
CoinflowEnv.sandbox — test cards, no real moneyCoinflowEnv.prod — live cards, real moneycontroller.tokenize() returns a Future<TokenizeResponse>:
token — payment token to send to your backendexpMonth, expYear — populated only for variants that collect expirySend the token to your server and call Coinflow’s checkout API to charge it. See the Checkout API reference for the full request shape.
MerchantTheme styles the rendered form. All fields optional.
The hosted form reflows responsively — at narrow widths the inputs wrap to multiple rows. To keep your Flutter container fitted, pass an onHeightChange callback to the controller and drive CoinflowCardFormWidget.height from it:
The callback receives the rendered content height in logical pixels. Without this wiring the form may be clipped if it wraps.