screens/DSCheckoutForm

DSCheckoutForm

screens
since v2.0

Complete 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

PropTypeDefaultDescription
orderSummaryreqDSOrderSummaryItems, subtotal, tax, and total.
onSubmitreq((DSPaymentDetails) -> Void)Called with validated payment data.
isLoadingBoolfalseShows a spinner on the submit button.
errorMessageString?nilPayment 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.

Related Components