Swift SDK
Overview
CoinflowCardForm is a SwiftUI SDK that embeds Coinflow’s card tokenization form directly into iOS 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.
- Package:
coinflow-swift - Distribution: Swift Package Manager
- Current version:
0.1.0
Requirements
- iOS 15+
- Swift 5.9+
- Xcode 15+
Installation
Xcode UI
Package.swift
In Xcode: File → Add Package Dependencies… and enter:
Select version 0.1.0 (or “Up to Next Major”), then add the CoinflowCardForm library product to your app target.
Integration
Add the card form view
Drop CoinflowCardFormView into your SwiftUI layout and pass a CardFormCoordinator 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 you’d inject it via a build setting or environment variable rather than hard-coding it.
Configure the environment
Switch env based on build configuration:
.sandbox— test cards, no real money.prod— live cards, real money
Charge the token server-side
coordinator.tokenize() returns a TokenizeResponse:
token: String— payment token to send to your backendexpMonth: String?,expYear: String?— populated only for variants that collect expiry
Send the token to your server and call Coinflow’s checkout API to charge it. See the Checkout API reference for the full request shape.
Variants
Theming
MerchantTheme styles the rendered form. All fields optional.
All theme fields
Resources
- Source: github.com/coinflow-labs-us/coinflow-swift
- License: Apache 2.0
- Checkout API: Card Checkout endpoint

