DisbursementRefundScreenViewModel

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

ViewModel for the Disbursement Refund screen.

On submit it runs the full Disbursement refund flow against the SDK:

  1. refund — reverses a prior transaction back to the payee (HTTP 202).

  2. getRefundStatus — polls the outcome and posts it to refundStatus.

The screen shows the input form while refundStatus 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 refundStatus: ERROR CLASS: Symbol not found for MutableLiveData<ERROR CLASS: Symbol not found for RefundStatus?>

Holds the RefundStatus 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
fun refund()

Submits a Disbursement refund, then polls the status and posts the resulting RefundStatus to refundStatus.