CardPayment
public class CardPayment : ObservableObject, PaymentProcessAPI, CardProcess, PaymentProcessEditable
A manager class responsible for handling the lifecycle of a direct Card payment.
This class manages the state of card entry fields (number, expiry, CVV, holder name),
validates user input, and orchestrates the transition to the authorization phase.
It conforms to ObservableObject to drive SwiftUI or Combine-based UIs.
-
The current validation status of the card entry form.
Observes this property to determine if the form is
.valid,.invalid, or.active(editing in progress).Declaration
Swift
@Published public var status: CardEntryStatus { get set } -
Restricts or enables specific card schemes (e.g., Visa, Mastercard) for this payment session.
Declaration
Swift
public func enable(cardSchemes cardSchemeSet: Set<CardScheme>?)Parameters
cardSchemeSetA set of allowed
CardSchemes. Ifnil, standard defaults may apply based on merchant configuration. -
Prepares the payment process for authorization and retrieves the request receiver.
This method transitions the internal state to
.authorizationif the card data is valid.Declaration
Swift
public func obtainPaymentRequestReceiver() -> MerchantRequestReceiver<BaseRequestPayload>?Return Value
A
MerchantRequestReceivercontaining the payload if the transition is successful; otherwisenil.