Skip to content

Commit

Permalink
Simplify isTTPPaymentInProgress implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
samiuelson committed Nov 15, 2024
1 parent f2efc1a commit fb056c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class CardReaderPaymentViewModel @Inject constructor(
paymentOrRefund = arguments.paymentOrRefund,
cardReaderType = arguments.cardReaderType,
isTTPPaymentInProgress = isTTPPaymentInProgress,
onTTPPaymentStateChanged = { isTTPPaymentInProgress = it }
)

val viewStateData: LiveData<ViewState> = paymentController.viewStateData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ class CardReaderPaymentController(
private val paymentReceiptShare: PaymentReceiptShare,
private val paymentOrRefund: CardReaderFlowParam.PaymentOrRefund,
private val cardReaderType: CardReaderType,
private val isTTPPaymentInProgress: Boolean,
private val onTTPPaymentStateChanged: (Boolean) -> Unit,
private var isTTPPaymentInProgress: Boolean,
) {
private val viewState = MutableLiveData<ViewState>(LoadingDataState(::onCancelPaymentFlow))
val viewStateData: LiveData<ViewState> = viewState
Expand Down Expand Up @@ -231,7 +230,7 @@ class CardReaderPaymentController(
return@launch
}
launch {
onTTPPaymentStateChanged(cardReaderType == CardReaderType.BUILT_IN)
isTTPPaymentInProgress = (cardReaderType == CardReaderType.BUILT_IN)
collectPaymentFlow(cardReaderManager, order)
}
launch {
Expand Down

0 comments on commit fb056c7

Please sign in to comment.