PaymentFlowViewModel
ViewModel for managing payment operations data. Handles fetching and storing payment methods and consents.
Types
Result of deleting a payment consent
Event that wraps payment status with the flow type that triggered it
Properties
Functions
Fetches available payment methods and consents. Should only be called once from the parent component.
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.
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.