-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12977 from woocommerce/custom-payment-ui-6-use-pa…
…yment-controller-in-pos [POS][Custom payment UI] – Switch to Payment Controller in POS Totals | Base PR
- Loading branch information
Showing
44 changed files
with
6,157 additions
and
928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...e/android/ui/payments/cardreader/payment/controller/CardReaderPaymentControllerFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package com.woocommerce.android.ui.payments.cardreader.payment.controller | ||
|
||
import com.woocommerce.android.AppPrefs | ||
import com.woocommerce.android.cardreader.CardReaderManager | ||
import com.woocommerce.android.tools.SelectedSite | ||
import com.woocommerce.android.ui.orders.details.OrderDetailRepository | ||
import com.woocommerce.android.ui.payments.cardreader.CardReaderCountryConfigProvider | ||
import com.woocommerce.android.ui.payments.cardreader.onboarding.CardReaderFlowParam.PaymentOrRefund | ||
import com.woocommerce.android.ui.payments.cardreader.onboarding.CardReaderFlowParam.PaymentOrRefund.Payment.PaymentType | ||
import com.woocommerce.android.ui.payments.cardreader.onboarding.CardReaderOnboardingChecker | ||
import com.woocommerce.android.ui.payments.cardreader.onboarding.CardReaderType | ||
import com.woocommerce.android.ui.payments.cardreader.payment.CardReaderInteracRefundErrorMapper | ||
import com.woocommerce.android.ui.payments.cardreader.payment.CardReaderInteracRefundableChecker | ||
import com.woocommerce.android.ui.payments.cardreader.payment.CardReaderPaymentCollectibilityChecker | ||
import com.woocommerce.android.ui.payments.cardreader.payment.CardReaderPaymentErrorMapper | ||
import com.woocommerce.android.ui.payments.cardreader.payment.CardReaderPaymentOrderHelper | ||
import com.woocommerce.android.ui.payments.receipt.PaymentReceiptHelper | ||
import com.woocommerce.android.ui.payments.receipt.PaymentReceiptShare | ||
import com.woocommerce.android.ui.payments.tracking.CardReaderTrackingInfoKeeper | ||
import com.woocommerce.android.ui.payments.tracking.PaymentsFlowTracker | ||
import com.woocommerce.android.util.CoroutineDispatchers | ||
import com.woocommerce.android.util.CurrencyFormatter | ||
import org.wordpress.android.fluxc.store.WooCommerceStore | ||
import javax.inject.Inject | ||
import kotlin.reflect.KMutableProperty0 | ||
|
||
class CardReaderPaymentControllerFactory @Inject constructor( | ||
private val cardReaderManager: CardReaderManager, | ||
private val orderRepository: OrderDetailRepository, | ||
private val selectedSite: SelectedSite, | ||
private val appPrefs: AppPrefs = AppPrefs, | ||
private val paymentCollectibilityChecker: CardReaderPaymentCollectibilityChecker, | ||
private val interacRefundableChecker: CardReaderInteracRefundableChecker, | ||
private val tracker: PaymentsFlowTracker, | ||
private val trackCancelledFlow: CardReaderTrackCanceledFlowAction, | ||
private val currencyFormatter: CurrencyFormatter, | ||
private val errorMapper: CardReaderPaymentErrorMapper, | ||
private val interacRefundErrorMapper: CardReaderInteracRefundErrorMapper, | ||
private val wooStore: WooCommerceStore, | ||
private val dispatchers: CoroutineDispatchers, | ||
private val cardReaderTrackingInfoKeeper: CardReaderTrackingInfoKeeper, | ||
private val paymentStateProvider: CardReaderPaymentStateProvider, | ||
private val cardReaderPaymentOrderHelper: CardReaderPaymentOrderHelper, | ||
private val paymentReceiptHelper: PaymentReceiptHelper, | ||
private val cardReaderOnboardingChecker: CardReaderOnboardingChecker, | ||
private val cardReaderConfigProvider: CardReaderCountryConfigProvider, | ||
private val paymentReceiptShare: PaymentReceiptShare, | ||
) { | ||
fun create( | ||
orderId: Long, | ||
paymentType: PaymentType, | ||
isTTPPaymentInProgress: KMutableProperty0<Boolean>, | ||
): CardReaderPaymentController = CardReaderPaymentController( | ||
cardReaderManager = cardReaderManager, | ||
orderRepository = orderRepository, | ||
selectedSite = selectedSite, | ||
appPrefs = appPrefs, | ||
paymentCollectibilityChecker = paymentCollectibilityChecker, | ||
interacRefundableChecker = interacRefundableChecker, | ||
tracker = tracker, | ||
trackCancelledFlow = trackCancelledFlow, | ||
currencyFormatter = currencyFormatter, | ||
errorMapper = errorMapper, | ||
interacRefundErrorMapper = interacRefundErrorMapper, | ||
wooStore = wooStore, | ||
dispatchers = dispatchers, | ||
cardReaderTrackingInfoKeeper = cardReaderTrackingInfoKeeper, | ||
paymentStateProvider = paymentStateProvider, | ||
cardReaderPaymentOrderHelper = cardReaderPaymentOrderHelper, | ||
paymentReceiptHelper = paymentReceiptHelper, | ||
cardReaderOnboardingChecker = cardReaderOnboardingChecker, | ||
cardReaderConfigProvider = cardReaderConfigProvider, | ||
paymentReceiptShare = paymentReceiptShare, | ||
paymentOrRefund = PaymentOrRefund.Payment( | ||
orderId = orderId, | ||
paymentType = paymentType | ||
), | ||
cardReaderType = CardReaderType.EXTERNAL, | ||
isTTPPaymentInProgress = isTTPPaymentInProgress, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.