FaciPayCheckout.start(...) apresenta o checkout (sheet com WKWebView) e devolve um CheckoutResult.
FaciPayCheckout.start(
    from: viewController,
    references: [
        PaymentReference(referenceNumber: "ORD_001", referenceAmount: 5000.0) // AOA
    ],
    createOrder: {
        let response = await MyBackendAPI.createPaymentOrder(amount: 5000.0)
        if let txnId = response.transactionId {
            return .success(merchantTransactionId: txnId)
        } else {
            return .failure(message: "Falha ao criar ordem", cause: response.error)
        }
    },
    completion: { result in
        switch result {
        case .approved(let payment): print("Aprovado:", payment.orderId)
        case .pending(let payment):  print("Pendente:", payment.orderId)
        case .cancelled:             print("Cancelado")
        case .failed(let error):     print("Erro:", error.localizedDescription)
        }
    },
    customerInfo: CustomerInfo(name: "João Silva", phone: "923000000"),
    config: FaciPayConfig(
        language: .portuguese,
        theme: .light,
        defaultPaymentMethod: .mcxExpress,
        referencePaymentLifeSpan: 1440 // minutos
    )
)

SwiftUI (async)

let result = await FaciPayCheckout.start(
    references: [PaymentReference(referenceNumber: "ORD_001", referenceAmount: 5000.0)],
    createOrder: { .success(merchantTransactionId: try await createOrder()) },
    customerInfo: CustomerInfo(name: "João Silva", phone: "923000000")
)

Parâmetros

from
UIViewController
obrigatório
O view controller que apresenta o checkout (modo UIKit).
references
[PaymentReference]
obrigatório
Itens a pagar. referenceNumber, referenceAmount (Double, > 0), referenceQuantity (default 1), referenceTotalQuantity (opcional). totalAmount é calculado.
createOrder
() async -> CreateOrderResult
obrigatório
Cria a ordem no teu backend. .success(merchantTransactionId:) ou .failure(message:cause:).
customerInfo
CustomerInfo
name, phone (244XXXXXXXXX ou 9XXXXXXXX), email (opcional).
config
FaciPayConfig
language, theme, defaultPaymentMethod, allowedPaymentMethods, showUIOfProcessingInfo, referencePaymentLifeSpan, showAmount.

Próximo passo: Resultado & erros

CheckoutResult, PaymentResult e FaciPayError.