coinflow-card-form is a Jetpack Compose SDK that embeds Coinflow’s card tokenization form directly into Android apps. 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.
cash.coinflow:coinflow-card-form0.2.0minSdk 24+Drop CoinflowCardFormView into your Compose layout 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 read from a BuildConfig field, not hard-coded.
CoinflowEnv.SANDBOX — test cards, no real moneyCoinflowEnv.PROD — live cards, real moneycontroller.tokenize() is a suspend function. It returns a TokenizeResponse:
token: String — payment token to send to your backendexpMonth: String?, expYear: String? — 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 Compose container fitted, listen for height changes via the onHeightChange callback:
The callback receives the rendered content height in CSS pixels (1:1 with dp at default WebView density). Without this wiring the form may be clipped if it wraps.