deferPaymentRefund

Collects a card PIN for an EBT payment via a ForageVaultElement (either a ForagePINEditText or a ForagePinPad) and defers the refund of the payment to the server.

  • On success, the data property of the ForageApiResponse.Success object resolves with an empty string.

  • On failure, the response includes a list of ForageError objects that you can unpack to troubleshoot the issue.

// Example deferPaymentRefund call in a PosDeferPaymentRefundViewModel.kt
class PosDeferPaymentRefundViewModel : ViewModel() {
var paymentRef: String = ""

fun deferPaymentRefund(forageVaultElement: ForagePINEditText) = viewModelScope.launch {
val forageTerminalSdk = ForageTerminalSDK.init(...) // may throw!
val deferPaymentRefundParams = DeferPaymentRefundParams(
forageVaultElement = forageVaultElement,
paymentRef
)
val response = forage.deferPaymentRefund(deferPaymentRefundParams)

when (response) {
is ForageApiResponse.Success -> {
// do something with response.data
}
is ForageApiResponse.Failure -> {
// do something with response.errors
}
}
}
}

Return

A ForageAPIResponse indicating the success or failure of the secure PIN submission. On success, returns Nothing. On failure, the response includes a list of ForageError objects that you can unpack to troubleshoot the issue.

Parameters

params

The DeferPaymentRefundParams parameters required for refunding a Payment.

See also