CollectionPayScreenViewModel

class CollectionPayScreenViewModel(defaultRepository: ERROR CLASS: Symbol not found for DefaultRepository, credentialStorage: CredentialStorage, dispatchers: DispatcherProvider, sampleConfig: SampleConfig) : BaseScreenViewModel

ViewModel for the Collection Request-to-Pay screen.

On submit it runs the full Collection request-to-pay flow against the SDK:

  1. requestToPay — asks the payer to approve a debit from their wallet (HTTP 202).

  2. An optional requestToPayDeliveryNotification when a delivery note is provided.

  3. requestToPayTransactionStatus — polls the outcome (RequestToPayStatus) and posts it to requestToPayStatus.

The screen shows the input form while requestToPayStatus is null and the result once it is set. Authentication is handled automatically by the SDK's interceptor/authenticator, so the ViewModel only guards on the presence of an access token before starting.

Constructors

Link copied to clipboard
constructor(defaultRepository: ERROR CLASS: Symbol not found for DefaultRepository, credentialStorage: CredentialStorage, dispatchers: DispatcherProvider, sampleConfig: SampleConfig)

Properties

Link copied to clipboard
val amount: ERROR CLASS: Symbol not found for LiveData<kotlin/String>

The current payment amount entered in the form.

Link copied to clipboard
val deliveryNote: ERROR CLASS: Symbol not found for LiveData<kotlin/String>

The current delivery note entered in the form.

Link copied to clipboard
val financialId: ERROR CLASS: Symbol not found for LiveData<kotlin/String>

The current financial ID entered in the form.

Link copied to clipboard
val payerMessage: ERROR CLASS: Symbol not found for LiveData<kotlin/String>

The current payer message entered in the form.

Link copied to clipboard
val payerNote: ERROR CLASS: Symbol not found for LiveData<kotlin/String>

The current payer note entered in the form.

Link copied to clipboard
val phoneNumber: ERROR CLASS: Symbol not found for LiveData<kotlin/String>

The current phone number entered in the form.

Link copied to clipboard
val referenceIdToRefund: ERROR CLASS: Symbol not found for LiveData<kotlin/String>

The current reference ID to refund entered in the form.

Link copied to clipboard
var requestToPayStatus: ERROR CLASS: Symbol not found for MutableLiveData<ERROR CLASS: Symbol not found for RequestToPayStatus?>

Holds the RequestToPayStatus returned by the API; null while no request has succeeded.

Link copied to clipboard
val showProgressBar: ERROR CLASS: Unresolved name: MutableLiveData

Controls whether the circular progress indicator is shown instead of the screen content.

Link copied to clipboard
val snackBarStateFlow: ERROR CLASS: Symbol not found for SharedFlow<io/rekast/sdk/sample/utils/SnackBarComponentConfiguration>

Flow of SnackBarComponentConfiguration events to be displayed as snack bars.

Functions

Link copied to clipboard
fun onAmountUpdated(amount: String)

Updates the amount field value.

Link copied to clipboard
fun onDeliveryNoteUpdated(deliveryNote: String)

Updates the delivery note field value.

Link copied to clipboard
fun onFinancialIdUpdated(financialId: String)

Updates the financial ID field value.

Link copied to clipboard
fun onPayerMessageUpdated(payerMessage: String)

Updates the payer message field value.

Link copied to clipboard
fun onPayerNoteUpdated(payerNote: String)

Updates the payer note field value.

Link copied to clipboard
fun onPhoneNumberUpdated(phoneNumber: String)

Updates the phone number field value.

Link copied to clipboard
fun onReferenceIdToRefundUpdated(referenceIdToRefund: String)

Updates the reference ID to refund field value.

Link copied to clipboard

Submits a Collection request-to-pay, optionally sends a delivery note, then polls the status and posts the resulting RequestToPayStatus to requestToPayStatus.