screens/DSCheckoutForm
DSCheckoutForm
screensComplete payment form with card number, expiry, CVV, billing address, and an order summary sidebar. Includes real-time card brand detection.
iOS 17+
Purpose
In-app purchases, subscriptions, and any transactional payment step.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| orderSummaryreq | DSOrderSummary | — | Items, subtotal, tax, and total. |
| onSubmitreq | ((DSPaymentDetails) -> Void) | — | Called with validated payment data. |
| isLoading | Bool | false | Shows a spinner on the submit button. |
| errorMessage | String? | nil | Payment error from the server. |
Examples
Subscription checkout
One-step payment for a monthly plan.
swift
DSCheckoutForm(
orderSummary: DSOrderSummary(
items: [DSOrderItem(label: "Pro Plan — Monthly", price: 19.00)],
tax: 1.52,
total: 20.52
),
isLoading: viewModel.isProcessing,
errorMessage: viewModel.paymentError
) { details in
viewModel.processPayment(details)
}Usage Guidelines
- Never store raw card numbers. Pass to Stripe/RevenueCat SDK only.
- Always show the total amount prominently before the submit button.