PaymentFlowViewModel

ViewModel for managing payment operations data. Handles fetching and storing payment methods and consents.

Constructors

Link copied to clipboard
constructor(airwallex: Airwallex, session: AirwallexSession)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed class DeleteConsentResult

Result of deleting a payment consent

Link copied to clipboard
Link copied to clipboard

Event that wraps payment status with the flow type that triggered it

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun checkoutWithCvc(paymentConsent: PaymentConsent, cvc: String): Job
Link copied to clipboard
Link copied to clipboard
fun checkoutWithNewCard(card: PaymentMethod.Card, saveCard: Boolean, billing: Billing?): Job
Link copied to clipboard
fun checkoutWithoutCvc(paymentConsent: PaymentConsent)
Link copied to clipboard
fun deletePaymentConsent(paymentConsent: PaymentConsent): Job
Link copied to clipboard

Fetches available payment methods and consents. Should only be called once from the parent component.

Link copied to clipboard
Link copied to clipboard

Subscribe listener to paymentResult, cancelling any previous subscription. The channel is single-receiver, so a stale collector from a dismissed UI would otherwise swallow results meant for the current one.

Link copied to clipboard
fun trackScreenViewed(eventName: String, params: Map<String, Any> = emptyMap())
Link copied to clipboard
Link copied to clipboard

Swap the session this VM operates on. The VM is Activity-scoped, so without this a second checkout on the same Activity would reuse the factory-injected session and confirm against an already-completed PaymentIntent. Resets per-session caches so PaymentSheet refetches methods/consents.