Skip to content

Commit

Permalink
Merge pull request #12877 from woocommerce/custom-payment-ui-3
Browse files Browse the repository at this point in the history
[POS] Custom Payment UI — Part 3 | Emitting UI–agnostic payment states in `CardReaderPaymentController`
  • Loading branch information
samiuelson authored Nov 19, 2024
2 parents 4c8e61c + 0c4e9ec commit a73aa7f
Show file tree
Hide file tree
Showing 6 changed files with 562 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import com.woocommerce.android.ui.payments.cardreader.CardReaderCountryConfigPro
import com.woocommerce.android.ui.payments.cardreader.onboarding.CardReaderOnboardingChecker
import com.woocommerce.android.ui.payments.cardreader.payment.controller.CardReaderPaymentController
import com.woocommerce.android.ui.payments.cardreader.payment.controller.CardReaderPaymentEvent
import com.woocommerce.android.ui.payments.cardreader.payment.controller.CardReaderPaymentStateProvider
import com.woocommerce.android.ui.payments.cardreader.payment.controller.CardReaderTrackCanceledFlowAction
import com.woocommerce.android.ui.payments.receipt.PaymentReceiptHelper
import com.woocommerce.android.ui.payments.receipt.PaymentReceiptShare
import com.woocommerce.android.ui.payments.tracking.CardReaderTrackingInfoKeeper
Expand All @@ -41,13 +43,15 @@ class CardReaderPaymentViewModel @Inject constructor(
paymentCollectibilityChecker: CardReaderPaymentCollectibilityChecker,
interacRefundableChecker: CardReaderInteracRefundableChecker,
tracker: PaymentsFlowTracker,
trackCancelledFlow: CardReaderTrackCanceledFlowAction,
currencyFormatter: CurrencyFormatter,
errorMapper: CardReaderPaymentErrorMapper,
interacRefundErrorMapper: CardReaderInteracRefundErrorMapper,
wooStore: WooCommerceStore,
dispatchers: CoroutineDispatchers,
cardReaderTrackingInfoKeeper: CardReaderTrackingInfoKeeper,
cardReaderPaymentReaderTypeStateProvider: CardReaderPaymentReaderTypeStateProvider,
paymentStateProvider: CardReaderPaymentStateProvider,
cardReaderPaymentOrderHelper: CardReaderPaymentOrderHelper,
paymentReceiptHelper: PaymentReceiptHelper,
cardReaderOnboardingChecker: CardReaderOnboardingChecker,
Expand All @@ -71,13 +75,15 @@ class CardReaderPaymentViewModel @Inject constructor(
paymentCollectibilityChecker = paymentCollectibilityChecker,
interacRefundableChecker = interacRefundableChecker,
tracker = tracker,
trackCancelledFlow = trackCancelledFlow,
currencyFormatter = currencyFormatter,
errorMapper = errorMapper,
interacRefundErrorMapper = interacRefundErrorMapper,
wooStore = wooStore,
dispatchers = dispatchers,
cardReaderTrackingInfoKeeper = cardReaderTrackingInfoKeeper,
cardReaderPaymentReaderTypeStateProvider = cardReaderPaymentReaderTypeStateProvider,
paymentStateProvider = paymentStateProvider,
cardReaderPaymentOrderHelper = cardReaderPaymentOrderHelper,
paymentReceiptHelper = paymentReceiptHelper,
cardReaderOnboardingChecker = cardReaderOnboardingChecker,
Expand All @@ -88,6 +94,7 @@ class CardReaderPaymentViewModel @Inject constructor(
isTTPPaymentInProgress = ::isTTPPaymentInProgress,
)

@Suppress("DEPRECATION")
val viewStateData: LiveData<ViewState> = paymentController.viewStateData

override val event: LiveData<MultiLiveEvent.Event> =
Expand Down
Loading

0 comments on commit a73aa7f

Please sign in to comment.