diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 147f05f3df4..c0b0ccde97c 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -5,9 +5,11 @@
-----
- [*] Fix Dashboard card menu sizing to fit bigger font sizes and longer text. [https://github.com/woocommerce/woocommerce-android/pull/13184]
- [*] Fixed overlap issue in Settings > WooCommerce Version [https://github.com/woocommerce/woocommerce-android/pull/13183]
-- [*] Fixed a crash on the order details [https://github.com/woocommerce/woocommerce-android/pull/13191]
+- [*] Removed Tap To Pay usage survey [https://github.com/woocommerce/woocommerce-android/pull/13207]
- [**] Fixed a crash when a shop manager was trying to install or activate plugin in the POS onboarding [https://github.com/woocommerce/woocommerce-android/pull/13203]
- [***] Orders: Merchants can now bulk update the status of their orders [https://github.com/woocommerce/woocommerce-android/pull/13245]
+- [*] Fixed a crash on the order details [https://github.com/woocommerce/woocommerce-android/pull/13191]
+- [**] Introduced fallback logic for the barcode scanner to use the front-facing camera when a back-facing camera is unavailable [https://github.com/woocommerce/woocommerce-android/pull/13230]
21.3
-----
diff --git a/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/AppPrefsTest.kt b/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/AppPrefsTest.kt
index 5d17090b4bc..bbe3685b146 100644
--- a/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/AppPrefsTest.kt
+++ b/WooCommerce/src/androidTest/kotlin/com/woocommerce/android/AppPrefsTest.kt
@@ -492,18 +492,6 @@ class AppPrefsTest {
).isFalse
}
- @Test
- fun givenTTPWasUsedAtLeastOnceNeverInvokedThenIsTTPWasUsedAtLeastOnceReturnsFalse() {
- assertThat(AppPrefs.isTTPWasUsedAtLeastOnce()).isFalse
- }
-
- @Test
- fun givenTTPWasUsedAtLeastOnceInvokedThenIsTTPWasUsedAtLeastOnceReturnsTrue() {
- AppPrefs.setTTPWasUsedAtLeastOnce()
-
- assertThat(AppPrefs.isTTPWasUsedAtLeastOnce()).isTrue
- }
-
@Test
fun givenIppWasNotUsedWhenGetCardReaderLastSuccessfulPaymentThenTimeReturnedZero() {
assertThat(AppPrefs.getCardReaderLastSuccessfulPaymentTime()).isEqualTo(0L)
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/AppPrefs.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/AppPrefs.kt
index 5dc87271cfc..75d8a9abdf5 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/AppPrefs.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/AppPrefs.kt
@@ -191,9 +191,6 @@ object AppPrefs {
// Was the IPP feedback survey banner dismissed forever
IPP_FEEDBACK_SURVEY_BANNER_DISMISSED_FOREVER,
- // Was the Tap To Pay used at least once
- TTP_WAS_USED_AT_LEAST_ONCE,
-
// Whether onboarding tasks have been completed or not for a given site
STORE_ONBOARDING_TASKS_COMPLETED,
@@ -941,13 +938,6 @@ object AppPrefs {
setBoolean(UndeletablePrefKey.IPP_FEEDBACK_SURVEY_BANNER_DISMISSED_FOREVER, dismissedForever)
}
- fun isTTPWasUsedAtLeastOnce() =
- getBoolean(UndeletablePrefKey.TTP_WAS_USED_AT_LEAST_ONCE, false)
-
- fun setTTPWasUsedAtLeastOnce() {
- setBoolean(UndeletablePrefKey.TTP_WAS_USED_AT_LEAST_ONCE, true)
- }
-
fun updateOnboardingCompletedStatus(siteId: Int, completed: Boolean) {
setBoolean(
key = getStoreOnboardingKeyFor(siteId),
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/AppUrls.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/AppUrls.kt
index fe58f2decbf..38ae2c52a45 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/AppUrls.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/AppUrls.kt
@@ -47,7 +47,6 @@ object AppUrls {
const val CROWDSIGNAL_STORE_SETUP_SURVEY =
"https://automattic.survey.fm/woo-mobile-%E2%80%93-store-setup-survey-2022"
- const val CROWDSIGNAL_TAP_TO_PAY_SURVEY = "https://automattic.survey.fm/woo-app-%E2%80%93-first-ttp-survey"
val CROWDSIGNAL_PRODCUT_CREATION_WITH_AI_SURVEY =
if (BuildConfig.DEBUG) {
"https://automattic.survey.fm/testing-debug-product-creation-with-ai-dec-2023"
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsEvent.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsEvent.kt
index 9e3cf43110c..7a7fff21286 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsEvent.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsEvent.kt
@@ -539,7 +539,6 @@ enum class AnalyticsEvent(override val siteless: Boolean = false) : IAnalyticsEv
PAYMENTS_HUB_CASH_ON_DELIVERY_TOGGLED_LEARN_MORE_TAPPED,
IN_PERSON_PAYMENTS_LEARN_MORE_TAPPED,
PAYMENTS_HUB_TAP_TO_PAY_TAPPED,
- PAYMENTS_HUB_TAP_TO_PAY_FEEDBACK_TAPPED,
PAYMENTS_HUB_TAP_TO_PAY_ABOUT_TAPPED,
// -- Payments Hub - Payout Summary (Previously called Deposit summary)
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsTracker.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsTracker.kt
index d7cb4e10714..e53b8b04a19 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsTracker.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsTracker.kt
@@ -368,7 +368,6 @@ class AnalyticsTracker private constructor(
const val VALUE_SIMPLE_PAYMENTS_FLOW = "simple_payment"
const val VALUE_SIMPLE_PAYMENTS_FEEDBACK = "simple_payments"
- const val VALUE_TAP_TO_PAY_FEEDBACK = "tap_to_pay"
const val VALUE_SIMPLE_PAYMENTS_COLLECT_CARD = "card"
const val VALUE_SIMPLE_PAYMENTS_COLLECT_CASH = "cash"
const val VALUE_SIMPLE_PAYMENTS_COLLECT_LINK = "payment_link"
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/model/FeatureFeedbackSettings.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/model/FeatureFeedbackSettings.kt
index c9b99b8c2e0..ceca0cae89d 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/model/FeatureFeedbackSettings.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/model/FeatureFeedbackSettings.kt
@@ -28,7 +28,6 @@ data class FeatureFeedbackSettings(
PRODUCT_ADDONS,
SIMPLE_PAYMENTS_AND_ORDER_CREATION,
ANALYTICS_HUB,
- TAP_TO_PAY,
ORDER_SHIPPING_LINES
}
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/barcodescanner/BarcodeScanner.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/barcodescanner/BarcodeScanner.kt
index 61753b8ed5e..ebc942fb6fc 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/barcodescanner/BarcodeScanner.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/barcodescanner/BarcodeScanner.kt
@@ -57,7 +57,15 @@ fun BarcodeScanner(
}
}
val selector = remember {
- CameraSelector.Builder().requireLensFacing(CameraSelector.LENS_FACING_BACK).build()
+ val cameraProvider = cameraProviderFuture.get()
+ val hasBackCamera = cameraProvider.hasCamera(CameraSelector.DEFAULT_BACK_CAMERA)
+ val hasFrontCamera = cameraProvider.hasCamera(CameraSelector.DEFAULT_FRONT_CAMERA)
+
+ when {
+ hasBackCamera -> CameraSelector.DEFAULT_BACK_CAMERA
+ hasFrontCamera -> CameraSelector.DEFAULT_FRONT_CAMERA
+ else -> error(IllegalStateException("No available camera"))
+ }
}
DisposableEffect(lifecycleOwner) {
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/FeedbackSurveyFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/FeedbackSurveyFragment.kt
index 27a4135f02b..0031d555228 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/FeedbackSurveyFragment.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/FeedbackSurveyFragment.kt
@@ -26,7 +26,6 @@ import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_ORDER_
import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_PRODUCT_ADDONS_FEEDBACK
import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_SHIPPING_LABELS_M4_FEEDBACK
import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_SIMPLE_PAYMENTS_FEEDBACK
-import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_TAP_TO_PAY_FEEDBACK
import com.woocommerce.android.databinding.FragmentFeedbackSurveyBinding
import com.woocommerce.android.extensions.navigateSafely
import com.woocommerce.android.ui.base.BaseFragment
@@ -56,7 +55,6 @@ class FeedbackSurveyFragment : BaseFragment(R.layout.fragment_feedback_survey) {
SurveyType.SHIPPING_LABELS -> VALUE_SHIPPING_LABELS_M4_FEEDBACK
SurveyType.ADDONS -> VALUE_PRODUCT_ADDONS_FEEDBACK
SurveyType.ANALYTICS_HUB -> VALUE_ANALYTICS_HUB_FEEDBACK
- SurveyType.PAYMENTS_HUB_TAP_TO_PAY -> VALUE_TAP_TO_PAY_FEEDBACK
SurveyType.ORDER_SHIPPING_LINES -> VALUE_ORDER_SHIPPING_LINES_FEEDBACK
}
}
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/SurveyType.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/SurveyType.kt
index d1123314384..1215a8ea77f 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/SurveyType.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/feedback/SurveyType.kt
@@ -12,7 +12,6 @@ enum class SurveyType(private val untaggedUrl: String, private val milestone: In
ADDONS(AppUrls.ADDONS_SURVEY),
STORE_ONBOARDING(AppUrls.CROWDSIGNAL_STORE_SETUP_SURVEY),
ANALYTICS_HUB(AppUrls.CROWDSIGNAL_ANALYTICS_HUB_SURVEY),
- PAYMENTS_HUB_TAP_TO_PAY(AppUrls.CROWDSIGNAL_TAP_TO_PAY_SURVEY),
ORDER_SHIPPING_LINES(AppUrls.CROWDSIGNAL_ORDER_SHIPPING_LINES_SURVEY);
val url
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubFragment.kt
index b0c089d8d54..1e25885faa9 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubFragment.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubFragment.kt
@@ -14,7 +14,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.transition.Slide
import androidx.transition.TransitionManager
import com.google.android.material.textview.MaterialTextView
-import com.woocommerce.android.NavGraphMainDirections
import com.woocommerce.android.NavGraphPaymentFlowDirections
import com.woocommerce.android.R
import com.woocommerce.android.analytics.AnalyticsTracker
@@ -22,13 +21,11 @@ import com.woocommerce.android.databinding.FragmentPaymentsHubBinding
import com.woocommerce.android.extensions.navigateSafely
import com.woocommerce.android.ui.base.BaseFragment
import com.woocommerce.android.ui.base.UIMessageResolver
-import com.woocommerce.android.ui.feedback.SurveyType
import com.woocommerce.android.ui.main.AppBarStatus
import com.woocommerce.android.ui.orders.list.OrderListViewModel
import com.woocommerce.android.ui.payments.cardreader.onboarding.CardReaderFlowParam
import com.woocommerce.android.ui.payments.cardreader.onboarding.CardReaderOnboardingParams
import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.PaymentsHubEvents.NavigateToTapToPaySummaryScreen
-import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.PaymentsHubEvents.NavigateToTapToPaySurveyScreen
import com.woocommerce.android.ui.payments.taptopay.summary.TapToPaySummaryFragment
import com.woocommerce.android.util.ChromeCustomTabUtils
import com.woocommerce.android.util.UiHelpers
@@ -143,12 +140,6 @@ class PaymentsHubFragment : BaseFragment(R.layout.fragment_payments_hub) {
)
)
}
- is NavigateToTapToPaySurveyScreen -> {
- NavGraphMainDirections.actionGlobalFeedbackSurveyFragment(SurveyType.PAYMENTS_HUB_TAP_TO_PAY)
- .apply {
- findNavController().navigateSafely(this)
- }
- }
is MultiLiveEvent.Event.ShowDialog -> {
event.showDialog()
}
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubViewModel.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubViewModel.kt
index 02126f6a7ba..8e7c56c6402 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubViewModel.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubViewModel.kt
@@ -6,7 +6,6 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.map
-import com.woocommerce.android.AppPrefs
import com.woocommerce.android.AppPrefsWrapper
import com.woocommerce.android.AppUrls
import com.woocommerce.android.AppUrls.STRIPE_TAP_TO_PAY_DEVICE_REQUIREMENTS
@@ -17,10 +16,8 @@ import com.woocommerce.android.cardreader.CardReaderManager
import com.woocommerce.android.cardreader.config.CardReaderConfigForSupportedCountry
import com.woocommerce.android.cardreader.connection.CardReaderStatus
import com.woocommerce.android.cardreader.connection.event.SoftwareUpdateAvailability
-import com.woocommerce.android.model.FeatureFeedbackSettings
import com.woocommerce.android.model.UiString.UiStringRes
import com.woocommerce.android.tools.SelectedSite
-import com.woocommerce.android.ui.feedback.FeedbackRepository
import com.woocommerce.android.ui.payments.cardreader.CardReaderCountryConfigProvider
import com.woocommerce.android.ui.payments.cardreader.CashOnDeliverySettingsRepository
import com.woocommerce.android.ui.payments.cardreader.ClearCardReaderDataAction
@@ -74,8 +71,6 @@ class PaymentsHubViewModel @Inject constructor(
private val paymentsFlowTracker: PaymentsFlowTracker,
@Named("payment-menu") private val paymentMenuUtmProvider: UtmProvider,
private val tapToPayAvailabilityStatus: TapToPayAvailabilityStatus,
- private val appPrefs: AppPrefs,
- private val feedbackRepository: FeedbackRepository,
private val tapToPayUnavailableHandler: PaymentsHubTapToPayUnavailableHandler,
private val cardReaderDataAction: ClearCardReaderDataAction,
private val cardReaderManager: CardReaderManager,
@@ -203,19 +198,19 @@ class PaymentsHubViewModel @Inject constructor(
cashOnDeliveryItem,
HeaderItem(
label = UiStringRes(R.string.card_reader_card_readers_header),
- index = 10,
+ index = 9,
),
NonToggleableListItem(
icon = R.drawable.ic_shopping_cart,
label = UiStringRes(R.string.card_reader_purchase_card_reader),
- index = 11,
+ index = 10,
onClick = ::onPurchaseCardReaderClicked
),
NonToggleableListItem(
icon = R.drawable.ic_manage_card_reader,
label = UiStringRes(R.string.card_reader_manage_card_reader),
isEnabled = isOnboardingComplete,
- index = 12,
+ index = 11,
onClick = ::onManageCardReaderClicked
)
).apply {
@@ -250,16 +245,6 @@ class PaymentsHubViewModel @Inject constructor(
onClick = { onAboutTTPClicked(countryConfig as CardReaderConfigForSupportedCountry) },
)
)
- if (shouldShowTTPFeedbackRequest) {
- add(
- NonToggleableListItem(
- icon = R.drawable.ic_feedback_banner_logo,
- label = UiStringRes(R.string.card_reader_tap_to_pay_share_feedback),
- index = 9,
- onClick = ::onTapToPayFeedbackClicked
- )
- )
- }
}
}
@@ -269,7 +254,7 @@ class PaymentsHubViewModel @Inject constructor(
NonToggleableListItem(
icon = R.drawable.ic_card_reader_manual,
label = UiStringRes(R.string.settings_card_reader_manuals),
- index = 13,
+ index = 12,
onClick = { onCardReaderManualsClicked(countryConfig) }
)
)
@@ -281,7 +266,7 @@ class PaymentsHubViewModel @Inject constructor(
LearnMoreListItem(
icon = R.drawable.ic_info_outline_20dp,
label = UiStringRes(R.string.card_reader_detail_learn_more, containsHtml = true),
- index = 14,
+ index = 13,
onClick = ::onLearnMoreIppClicked
)
)
@@ -389,15 +374,6 @@ class PaymentsHubViewModel @Inject constructor(
triggerEvent(PaymentsHubEvents.NavigateToTapToPaySummaryScreen)
}
- private fun onTapToPayFeedbackClicked() {
- trackEvent(AnalyticsEvent.PAYMENTS_HUB_TAP_TO_PAY_FEEDBACK_TAPPED)
- feedbackRepository.saveFeatureFeedback(
- FeatureFeedbackSettings.Feature.TAP_TO_PAY,
- FeatureFeedbackSettings.FeedbackState.GIVEN
- )
- triggerEvent(PaymentsHubEvents.NavigateToTapToPaySurveyScreen)
- }
-
private fun onAboutTTPClicked(countryConfig: CardReaderConfigForSupportedCountry) {
trackEvent(AnalyticsEvent.PAYMENTS_HUB_TAP_TO_PAY_ABOUT_TAPPED)
triggerEvent(PaymentsHubEvents.NavigateToAboutTapToPay(countryConfig))
@@ -548,17 +524,6 @@ class PaymentsHubViewModel @Inject constructor(
selfHostedSiteId = selectedSite.get().selfHostedSiteId,
)
- private val shouldShowTTPFeedbackRequest: Boolean
- get() {
- val featureFeedbackSetting = feedbackRepository.getFeatureFeedbackSetting(
- FeatureFeedbackSettings.Feature.TAP_TO_PAY
- )
- return appPrefs.isTTPWasUsedAtLeastOnce() && (
- featureFeedbackSetting.feedbackState == FeatureFeedbackSettings.FeedbackState.UNANSWERED ||
- !featureFeedbackSetting.isFeedbackGivenMoreThanDaysAgo(SHOW_FEEDBACK_AFTER_USAGE_DAYS)
- )
- }
-
sealed class PaymentsHubEvents : MultiLiveEvent.Event() {
data class NavigateToCardReaderDetail(val cardReaderFlowParam: CardReaderFlowParam) : PaymentsHubEvents()
data class NavigateToPurchaseCardReaderFlow(
@@ -568,7 +533,6 @@ class PaymentsHubViewModel @Inject constructor(
data object NavigateToOrderCreationScreen : PaymentsHubEvents()
data object NavigateToTapToPaySummaryScreen : PaymentsHubEvents()
- data object NavigateToTapToPaySurveyScreen : PaymentsHubEvents()
data class NavigateToCardReaderManualsScreen(
val countryConfig: CardReaderConfigForSupportedCountry
) : PaymentsHubEvents()
@@ -601,7 +565,5 @@ class PaymentsHubViewModel @Inject constructor(
const val UTM_CAMPAIGN = "payments_menu_item"
const val UTM_SOURCE = "payments_menu"
private const val SOURCE = "payments_menu"
-
- private const val SHOW_FEEDBACK_AFTER_USAGE_DAYS = 30
}
}
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/methodselection/SelectPaymentMethodViewModel.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/methodselection/SelectPaymentMethodViewModel.kt
index c78a037ccdc..e096eb8e09e 100644
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/methodselection/SelectPaymentMethodViewModel.kt
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/methodselection/SelectPaymentMethodViewModel.kt
@@ -3,7 +3,6 @@ package com.woocommerce.android.ui.payments.methodselection
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.SavedStateHandle
-import com.woocommerce.android.AppPrefs
import com.woocommerce.android.R
import com.woocommerce.android.analytics.AnalyticsTracker
import com.woocommerce.android.analytics.AnalyticsTracker.Companion.VALUE_CARD_READER_TYPE_BUILT_IN
@@ -77,7 +76,6 @@ class SelectPaymentMethodViewModel @Inject constructor(
private val paymentsFlowTracker: PaymentsFlowTracker,
private val tapToPayAvailabilityStatus: TapToPayAvailabilityStatus,
private val cardReaderTrackingInfoKeeper: CardReaderTrackingInfoKeeper,
- private val appPrefs: AppPrefs = AppPrefs,
private val paymentsUtils: PaymentUtils,
private val logOrderCurrencyMismatchWithSiteSettings: SelectPaymentMethodCurrencyMissMatchLog,
) : ScopedViewModel(savedState) {
@@ -309,7 +307,6 @@ class SelectPaymentMethodViewModel @Inject constructor(
fun onTapToPayClicked() {
launch {
trackPaymentMethodSelection(VALUE_SIMPLE_PAYMENTS_COLLECT_CARD, VALUE_CARD_READER_TYPE_BUILT_IN)
- appPrefs.setTTPWasUsedAtLeastOnce()
triggerEvent(NavigateToCardReaderPaymentFlow(cardReaderPaymentFlowParam, BUILT_IN))
}
}
diff --git a/WooCommerce/src/main/res/values-ar/strings.xml b/WooCommerce/src/main/res/values-ar/strings.xml
index f240799f0fa..1419263fde6 100644
--- a/WooCommerce/src/main/res/values-ar/strings.xml
+++ b/WooCommerce/src/main/res/values-ar/strings.xml
@@ -1209,7 +1209,6 @@ Language: ar
يقبل قارئ البطاقات المدفوعات من خلال الضغط والرقائق والسحب باستخدام بطاقات الخصم والائتمان.
اقبل مدفوعات لا حصر لها بأمان وبشكل مباشر من هاتفك.
استخدم هاتفك لقبول الدفع\nبالبطاقة. جربها الآن.
- مشاركة ملاحظات
يتعذر تسجيل الدخول لأن إنشاء كلمة مرور التطبيق غير معتمد.
جارٍ إحضار الموقع…
حدث خطأ في أثناء إحضار موقعك على الويب
diff --git a/WooCommerce/src/main/res/values-de/strings.xml b/WooCommerce/src/main/res/values-de/strings.xml
index c4042c70557..fd4778c1bb0 100644
--- a/WooCommerce/src/main/res/values-de/strings.xml
+++ b/WooCommerce/src/main/res/values-de/strings.xml
@@ -1211,7 +1211,6 @@ Language: de
Die Anmeldung ist nicht möglich, weil die Erstellung von Anwendungspasswörtern nicht genehmigt wurde.
Website wird abgerufen …
Nutze dein Mobiltelefon zum Akzeptieren von\nKartenzahlungen. Teste es jetzt.
- Feedback teilen
Lädt…
Beim Abrufen der Website ist ein Fehler aufgetreten
Versuche es über die WP Admin-Seite erneut
diff --git a/WooCommerce/src/main/res/values-es/strings.xml b/WooCommerce/src/main/res/values-es/strings.xml
index f6c91661269..36352a864ab 100644
--- a/WooCommerce/src/main/res/values-es/strings.xml
+++ b/WooCommerce/src/main/res/values-es/strings.xml
@@ -1209,7 +1209,6 @@ Language: es
El lector de tarjetas acepta pagos con tarjetas de débito y crédito con toque, chip y banda magnética.
Acepta pagos sin contacto de forma segura directamente desde tu teléfono.
Utiliza tu teléfono para aceptar pagos con\ntarjeta. Pruébalo ahora.
- Compartir comentarios
No se puede acceder porque la creación de la contraseña de la aplicación no está aprobada.
Cargando sitio…
Se ha producido un error al cargar tu sitio web
diff --git a/WooCommerce/src/main/res/values-fr/strings.xml b/WooCommerce/src/main/res/values-fr/strings.xml
index de937787fdb..94207044339 100644
--- a/WooCommerce/src/main/res/values-fr/strings.xml
+++ b/WooCommerce/src/main/res/values-fr/strings.xml
@@ -1209,7 +1209,6 @@ Language: fr
Le lecteur de cartes accepte les paiements par carte de débit et de crédit : en appuyant la carte contre le lecteur, en la faisant glisser ou en utilisant la puce.
Acceptez des paiements sans contact en toute sécurité directement sur votre téléphone.
Utilisez votre téléphone pour accepter les paiements\npar carte. Essayez dès maintenant.
- Donner votre avis
Impossible de se connecter, car le mot de passe créé pour l’application n’est pas approuvé.
Récupération du site…
Une erreur est survenue lors de la récupération de votre site Web
diff --git a/WooCommerce/src/main/res/values-he/strings.xml b/WooCommerce/src/main/res/values-he/strings.xml
index 36371d22006..16952313ea9 100644
--- a/WooCommerce/src/main/res/values-he/strings.xml
+++ b/WooCommerce/src/main/res/values-he/strings.xml
@@ -1209,7 +1209,6 @@ Language: he_IL
בקורא הכרטיסים אפשר לשלם על ידי הצמדה, שבב והעברת הכרטיס באמצעות כרטיסי חיוב וכרטיסי אשראי.
לקבל תשלומים ללא מגע באופן מאובטח ישירות מהטלפון.
להשתמש בטלפון שלך כדי לקבל תשלום\nבכרטיסי אשראי. כדאי לנסות עכשיו.
- לשתף משוב
אין אפשרות להתחבר מאחר שיצירת הסיסמה באפליקציה לא אושרה.
מביא אתרים…
אירעה שגיאה בהבאת האתר
diff --git a/WooCommerce/src/main/res/values-id/strings.xml b/WooCommerce/src/main/res/values-id/strings.xml
index 5d9f8559996..dab5376fb65 100644
--- a/WooCommerce/src/main/res/values-id/strings.xml
+++ b/WooCommerce/src/main/res/values-id/strings.xml
@@ -1209,7 +1209,6 @@ Language: id
Pembaca kartu menerima pembayaran dengan chip serta secara mengetuk dan menggesek menggunakan kartu debit atau kartu kredit.
Terima pembayaran nirsentuh dengan aman langsung dari ponsel Anda.
Gunakan ponsel Anda untuk menerima pembayaran\nkartu. Coba sekarang.
- Bagikan Feedback
Tidak dapat login karena pembuatan kata sandi aplikasi tidak disetujui.
Mengambil situs…
Terjadi error saat mengambil situs web Anda.
diff --git a/WooCommerce/src/main/res/values-it/strings.xml b/WooCommerce/src/main/res/values-it/strings.xml
index 32831266726..e44d3516fd9 100644
--- a/WooCommerce/src/main/res/values-it/strings.xml
+++ b/WooCommerce/src/main/res/values-it/strings.xml
@@ -1209,7 +1209,6 @@ Language: it
Il lettore di carte accetta pagamenti contactless, chip e tramite strisciata con carte di debito e di credito.
Accetta in modo sicuro pagamenti contactless direttamente dal tuo telefono.
Usa il telefono per accettare i pagamenti\ncon carta. Prova ora.
- Condividi il feedback
Impossibile accedere perché la creazione della password dell\'applicazione non è stata approvata.
Sito in caricamento…
Si è verificato un errore durante il recupero del sito web
diff --git a/WooCommerce/src/main/res/values-ja/strings.xml b/WooCommerce/src/main/res/values-ja/strings.xml
index ee7500ef718..3e348cc1f2c 100644
--- a/WooCommerce/src/main/res/values-ja/strings.xml
+++ b/WooCommerce/src/main/res/values-ja/strings.xml
@@ -1209,7 +1209,6 @@ Language: ja_JP
カードリーダーは、デビットカードとクレジットカードのタップ決済、チップ決済、スワイプ決済に対応しています。
お使いのスマートフォンから非接触型決済を安全に直接受け付けることができます。
スマートフォンを使用してカードによる支払いを\n受け付けることができます。 今すぐお試しください。
- フィードバックを共有
アプリケーションパスワードの作成が承認されていないため、ログインできません。
サイトを取得中…
ウェブサイトの取得中にエラーが発生しました
diff --git a/WooCommerce/src/main/res/values-ko/strings.xml b/WooCommerce/src/main/res/values-ko/strings.xml
index 0fb2fed8394..42af79cabf3 100644
--- a/WooCommerce/src/main/res/values-ko/strings.xml
+++ b/WooCommerce/src/main/res/values-ko/strings.xml
@@ -1211,7 +1211,6 @@ Language: ko_KR
애플리케이션 비밀번호 생성이 승인되지 않아서 로그인할 수 없습니다.
사이트를 가져오는 중…
스마트폰을 사용하여 카드 결제 수락\n결제 지금 사용해 보세요.
- 피드백 공유
로드 중입니다…
웹사이트를 가져오는 동안 오류 발생
WP 관리자 페이지에서 다시 시도
diff --git a/WooCommerce/src/main/res/values-nl/strings.xml b/WooCommerce/src/main/res/values-nl/strings.xml
index d203d1c0d62..30cdfca69b0 100644
--- a/WooCommerce/src/main/res/values-nl/strings.xml
+++ b/WooCommerce/src/main/res/values-nl/strings.xml
@@ -1209,7 +1209,6 @@ Language: nl
De kaartlezer accepteert tik-, chip- en veegbetalingen met debit-en creditcards.
Accepteert contactloze betalingen veilig en rechtstreeks vanaf je telefoon.
Gebruik je telefoon om kaartbetalingen\nte accepteren Probeer het nu.
- Deel feedback
Inloggen mislukt omdat het maken van een applicatiewachtwoord niet goedgekeurd is.
Website ophalen…
Er heeft zich een fout voorgedaan tijdens het ophalen van je website
diff --git a/WooCommerce/src/main/res/values-pt-rBR/strings.xml b/WooCommerce/src/main/res/values-pt-rBR/strings.xml
index dab2171bbd0..6bad3589209 100644
--- a/WooCommerce/src/main/res/values-pt-rBR/strings.xml
+++ b/WooCommerce/src/main/res/values-pt-rBR/strings.xml
@@ -1211,7 +1211,6 @@ Language: pt_BR
Não foi possível fazer login porque a criação da senha do aplicativo não foi aprovada.
Buscando site…
Use seu celular para aceitar pagamentos\ncom cartão. Experimente agora.
- Compartilhar feedback
Carregando…
Fazer login
Ocorreu um erro ao buscar seu site
diff --git a/WooCommerce/src/main/res/values-ru/strings.xml b/WooCommerce/src/main/res/values-ru/strings.xml
index 335712315fb..07c974d84b1 100644
--- a/WooCommerce/src/main/res/values-ru/strings.xml
+++ b/WooCommerce/src/main/res/values-ru/strings.xml
@@ -1209,7 +1209,6 @@ Language: ru
Устройство чтения карт принимает платежи дебетовыми и кредитными картами. Их можно прикладывать, проводить или вставлять.
Принимайте бесконтактные платежи прямо в телефоне.
Для получения платежей по карте используйте\nсвой телефон. Попробуйте прямо сейчас.
- Отправить отзыв
Не удалось войти, поскольку не разрешается создавать пароль приложения.
Получение сайта…
Произошла ошибка при получении веб-сайта
diff --git a/WooCommerce/src/main/res/values-sv/strings.xml b/WooCommerce/src/main/res/values-sv/strings.xml
index 6a81ae85aa3..fd9041563d4 100644
--- a/WooCommerce/src/main/res/values-sv/strings.xml
+++ b/WooCommerce/src/main/res/values-sv/strings.xml
@@ -1209,7 +1209,6 @@ Language: sv_SE
Kortläsaren accepterar blipp, chipp och magnetremsa vid betalning med betal- och kreditkort.
Ta emot säkra kontaktlösa betalningsmetoder direkt från din telefon.
Använd din telefon för att ta emot kort\nbetalningar Prova nu.
- Dela feedback
Det går inte att logga in eftersom lösenordsskapandet i appen inte godkänts.
Hämtar webbplats …
Ett fel inträffade när webbsidan skulle hämtas
diff --git a/WooCommerce/src/main/res/values-tr/strings.xml b/WooCommerce/src/main/res/values-tr/strings.xml
index 1a9dfaabcba..b2474465118 100644
--- a/WooCommerce/src/main/res/values-tr/strings.xml
+++ b/WooCommerce/src/main/res/values-tr/strings.xml
@@ -1209,7 +1209,6 @@ Language: tr
Kart okuyucu, banka ve kredi kartlarıyla dokunarak, çiple ve kaydırarak yapılan ödemeleri kabul eder.
Temassız ödemeleri doğrudan telefonunuzdan güvenli bir şekilde alın.
Kart\nödemeleri almak için telefonunuzu kullanın. Şimdi deneyin.
- Görüşlerinizi Paylaşın
Uygulama şifresi oluşturma onaylanmadığından oturum açılamıyor.
Site getiriliyor…
Web siteniz getirilirken bir hata oluştu.
diff --git a/WooCommerce/src/main/res/values-zh-rCN/strings.xml b/WooCommerce/src/main/res/values-zh-rCN/strings.xml
index 065c812ae2c..bbb1258841b 100644
--- a/WooCommerce/src/main/res/values-zh-rCN/strings.xml
+++ b/WooCommerce/src/main/res/values-zh-rCN/strings.xml
@@ -1209,7 +1209,6 @@ Language: zh_CN
读卡器接受借记卡和信用卡的触碰、芯片读取和刷卡支付。
安全地接受直接通过您的手机进行非接触式支付。
使用您的手机接受银行卡\n付款。 立即试用。
- 分享反馈
无法登录,因为未批准应用程序创建密码。
正在获取站点…
获取您的网站时出错
diff --git a/WooCommerce/src/main/res/values-zh-rTW/strings.xml b/WooCommerce/src/main/res/values-zh-rTW/strings.xml
index b3e59461dcf..bce72fce4aa 100644
--- a/WooCommerce/src/main/res/values-zh-rTW/strings.xml
+++ b/WooCommerce/src/main/res/values-zh-rTW/strings.xml
@@ -1209,7 +1209,6 @@ Language: zh_TW
讀卡機接受信用卡和簽帳金融卡的輕觸、晶片和刷卡付款。
直接從手機安全地接受零接觸付款。
使用手機接受信用卡\n付款。 立即試用。
- 分享意見反應
無法登入,因為未核准建立應用程式密碼。
正在擷取網站…
擷取你的網站時發生錯誤
diff --git a/WooCommerce/src/main/res/values/strings.xml b/WooCommerce/src/main/res/values/strings.xml
index 47c440adbc5..80d7be8f3ec 100644
--- a/WooCommerce/src/main/res/values/strings.xml
+++ b/WooCommerce/src/main/res/values/strings.xml
@@ -1568,7 +1568,6 @@
TAP TO PAY
About Tap to Pay
Use your phone to accept card\npayments. Try it now.
- Share Feedback
Check Requirements
Tap to Pay is not available
To use Tap To Pay on Android, your device needs an NFC chip. To accept in-person payments, please purchase a Bluetooth card reader.
diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/SelectPaymentMethodViewModelTest.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/SelectPaymentMethodViewModelTest.kt
index 17b2f9a271d..696c91a73d4 100644
--- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/SelectPaymentMethodViewModelTest.kt
+++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/SelectPaymentMethodViewModelTest.kt
@@ -1,6 +1,5 @@
package com.woocommerce.android.ui.payments
-import com.woocommerce.android.AppPrefs
import com.woocommerce.android.AppUrls
import com.woocommerce.android.R
import com.woocommerce.android.cardreader.internal.payments.PaymentUtils
@@ -113,7 +112,6 @@ class SelectPaymentMethodViewModelTest : BaseUnitTest() {
private val learnMoreUrlProvider: LearnMoreUrlProvider = mock()
private val paymentsFlowTracker: PaymentsFlowTracker = mock()
private val tapToPayAvailabilityStatus: TapToPayAvailabilityStatus = mock()
- private val appPrefs: AppPrefs = mock()
private val paymentsUtils: PaymentUtils = mock()
private val cardReaderTrackingInfoKeeper: CardReaderTrackingInfoKeeper = mock()
private val logOrderCurrencyMismatchWithSiteSettings = mock()
@@ -588,19 +586,6 @@ class SelectPaymentMethodViewModelTest : BaseUnitTest() {
)
}
- @Test
- fun `when on tap too pay clicked, then app prefs stores ttp was used`() =
- testBlocking {
- // GIVEN
- val viewModel = initViewModel(Payment(1L, SIMPLE))
-
- // WHEN
- viewModel.onTapToPayClicked()
-
- // THEN
- verify(appPrefs).setTTPWasUsedAtLeastOnce()
- }
-
@Test
fun `given simple payment flow, when on connect to reader result, then failed tracked with simple payment flow`() =
testBlocking {
@@ -1226,7 +1211,6 @@ class SelectPaymentMethodViewModelTest : BaseUnitTest() {
paymentsFlowTracker,
tapToPayAvailabilityStatus,
cardReaderTrackingInfoKeeper,
- appPrefs,
paymentsUtils,
logOrderCurrencyMismatchWithSiteSettings,
)
diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubViewModelTest.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubViewModelTest.kt
index 6eee6309604..b06a04bd29f 100644
--- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubViewModelTest.kt
+++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/hub/PaymentsHubViewModelTest.kt
@@ -1,6 +1,5 @@
package com.woocommerce.android.ui.payments.hub
-import com.woocommerce.android.AppPrefs
import com.woocommerce.android.AppPrefsWrapper
import com.woocommerce.android.AppUrls
import com.woocommerce.android.AppUrls.WOOCOMMERCE_PURCHASE_CARD_READER_IN_COUNTRY
@@ -15,10 +14,8 @@ import com.woocommerce.android.cardreader.config.CardReaderConfigForUSA
import com.woocommerce.android.cardreader.config.CardReaderConfigForUnsupportedCountry
import com.woocommerce.android.cardreader.connection.CardReaderStatus
import com.woocommerce.android.cardreader.connection.event.SoftwareUpdateAvailability
-import com.woocommerce.android.model.FeatureFeedbackSettings
import com.woocommerce.android.model.UiString.UiStringRes
import com.woocommerce.android.tools.SelectedSite
-import com.woocommerce.android.ui.feedback.FeedbackRepository
import com.woocommerce.android.ui.payments.cardreader.CardReaderCountryConfigProvider
import com.woocommerce.android.ui.payments.cardreader.CashOnDeliverySettingsRepository
import com.woocommerce.android.ui.payments.cardreader.ClearCardReaderDataAction
@@ -32,7 +29,6 @@ import com.woocommerce.android.ui.payments.cardreader.onboarding.CardReaderOnboa
import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.CashOnDeliverySource.PAYMENTS_HUB
import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.PaymentsHubEvents.CardReaderUpdateAvailable
import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.PaymentsHubEvents.NavigateToTapToPaySummaryScreen
-import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.PaymentsHubEvents.NavigateToTapToPaySurveyScreen
import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.PaymentsHubEvents.OpenGenericWebView
import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.PaymentsHubEvents.ShowToast
import com.woocommerce.android.ui.payments.hub.PaymentsHubViewModel.PaymentsHubEvents.ShowToastString
@@ -69,8 +65,6 @@ import org.wordpress.android.fluxc.network.rest.wpcom.wc.WooError
import org.wordpress.android.fluxc.network.rest.wpcom.wc.WooErrorType
import org.wordpress.android.fluxc.network.rest.wpcom.wc.WooResult
import org.wordpress.android.fluxc.store.WooCommerceStore
-import java.util.Calendar
-import java.util.concurrent.TimeUnit
@ExperimentalCoroutinesApi
class PaymentsHubViewModelTest : BaseUnitTest() {
@@ -94,12 +88,6 @@ class PaymentsHubViewModelTest : BaseUnitTest() {
private val tapToPayAvailabilityStatus: TapToPayAvailabilityStatus = mock {
on { invoke() }.thenReturn(Available)
}
- private val appPrefs: AppPrefs = mock()
- private val feedbackRepository: FeedbackRepository = mock {
- on { getFeatureFeedbackSetting(any()) }.thenReturn(
- FeatureFeedbackSettings(FeatureFeedbackSettings.Feature.TAP_TO_PAY)
- )
- }
private val paymentsHubTapToPayUnavailableHandler: PaymentsHubTapToPayUnavailableHandler = mock()
private val cardReaderOnboardingChecker: CardReaderOnboardingChecker = mock()
@@ -1369,7 +1357,6 @@ class PaymentsHubViewModelTest : BaseUnitTest() {
whenever(cardReaderChecker.getOnboardingState()).thenReturn(
mock()
)
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
// WHEN
initViewModel()
@@ -1399,7 +1386,6 @@ class PaymentsHubViewModelTest : BaseUnitTest() {
whenever(cardReaderChecker.getOnboardingState()).thenReturn(
mock()
)
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
// WHEN
initViewModel()
@@ -1415,112 +1401,6 @@ class PaymentsHubViewModelTest : BaseUnitTest() {
}
}
- @Test
- fun `given ttp available and used and feedback not given, when view model started, then show feedback row`() =
- testBlocking {
- // GIVEN
- whenever(wooStore.getStoreCountryCode(selectedSite.get())).thenReturn("US")
- whenever(tapToPayAvailabilityStatus()).thenReturn(Available)
- whenever(cardReaderChecker.getOnboardingState()).thenReturn(
- mock()
- )
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
- whenever(feedbackRepository.getFeatureFeedbackSetting(FeatureFeedbackSettings.Feature.TAP_TO_PAY))
- .thenReturn(FeatureFeedbackSettings(FeatureFeedbackSettings.Feature.TAP_TO_PAY))
-
- // WHEN
- initViewModel()
-
- // THEN
- assertThat((viewModel.viewStateData.getOrAwaitValue()).rows).anyMatch {
- it is NonToggleableListItem &&
- it.icon == R.drawable.ic_feedback_banner_logo &&
- it.label == UiStringRes(R.string.card_reader_tap_to_pay_share_feedback) &&
- it.description == null &&
- it.index == 9 &&
- it.iconBadge == null
- }
- }
-
- @Test
- fun `given ttp available and used and feedback given more than 30 days ago, when view model started, then dont show feedback row`() =
- testBlocking {
- // GIVEN
- whenever(wooStore.getStoreCountryCode(selectedSite.get())).thenReturn("US")
- whenever(tapToPayAvailabilityStatus()).thenReturn(Available)
- whenever(cardReaderChecker.getOnboardingState()).thenReturn(
- mock()
- )
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
- whenever(feedbackRepository.getFeatureFeedbackSetting(FeatureFeedbackSettings.Feature.TAP_TO_PAY))
- .thenReturn(
- FeatureFeedbackSettings(
- FeatureFeedbackSettings.Feature.TAP_TO_PAY,
- FeatureFeedbackSettings.FeedbackState.GIVEN,
- Calendar.getInstance().time.time - TimeUnit.DAYS.toMillis(31)
- )
- )
-
- // WHEN
- initViewModel()
-
- // THEN
- assertThat((viewModel.viewStateData.getOrAwaitValue()).rows).noneMatch {
- it is NonToggleableListItem &&
- it.label == UiStringRes(R.string.card_reader_tap_to_pay_share_feedback)
- }
- }
-
- @Test
- fun `given ttp available and used and feedback given less than 30 days ago, when view model started, then show feedback row`() =
- testBlocking {
- // GIVEN
- whenever(wooStore.getStoreCountryCode(selectedSite.get())).thenReturn("US")
- whenever(tapToPayAvailabilityStatus()).thenReturn(Available)
- whenever(cardReaderChecker.getOnboardingState()).thenReturn(
- mock()
- )
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
- whenever(feedbackRepository.getFeatureFeedbackSetting(FeatureFeedbackSettings.Feature.TAP_TO_PAY))
- .thenReturn(
- FeatureFeedbackSettings(
- FeatureFeedbackSettings.Feature.TAP_TO_PAY,
- FeatureFeedbackSettings.FeedbackState.GIVEN,
- Calendar.getInstance().time.time - TimeUnit.DAYS.toMillis(29)
- )
- )
-
- // WHEN
- initViewModel()
-
- // THEN
- assertThat((viewModel.viewStateData.getOrAwaitValue()).rows).anyMatch {
- it is NonToggleableListItem &&
- it.icon == R.drawable.ic_feedback_banner_logo &&
- it.label == UiStringRes(R.string.card_reader_tap_to_pay_share_feedback) &&
- it.description == null &&
- it.index == 9
- }
- }
-
- @Test
- fun `given ttp available and not used, when view model started, then dont show feedback row`() =
- testBlocking {
- // GIVEN
- whenever(wooStore.getStoreCountryCode(selectedSite.get())).thenReturn("US")
- whenever(tapToPayAvailabilityStatus()).thenReturn(Available)
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(false)
-
- // WHEN
- initViewModel()
-
- // THEN
- assertThat((viewModel.viewStateData.getOrAwaitValue()).rows).noneMatch {
- it is NonToggleableListItem &&
- it.label == UiStringRes(R.string.card_reader_tap_to_pay_share_feedback)
- }
- }
-
@Test
fun `when learn more ipp clicked, then learn more button tracked with source`() =
testBlocking {
@@ -1583,14 +1463,13 @@ class PaymentsHubViewModelTest : BaseUnitTest() {
selfHostedSiteId = site.selfHostedSiteId
)
).thenReturn(true)
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
// WHEN
initViewModel()
// THEN
val rows = (viewModel.viewStateData.getOrAwaitValue()).rows
- assertThat(rows.map { it.index }).containsExactly(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
+ assertThat(rows.map { it.index }).containsExactly(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
}
@Test
@@ -1728,7 +1607,7 @@ class PaymentsHubViewModelTest : BaseUnitTest() {
)
)
assertThat(learnMoreListItems[0].icon).isEqualTo(R.drawable.ic_info_outline_20dp)
- assertThat(learnMoreListItems[0].index).isEqualTo(14)
+ assertThat(learnMoreListItems[0].index).isEqualTo(13)
}
@Test
@@ -1774,68 +1653,6 @@ class PaymentsHubViewModelTest : BaseUnitTest() {
assertThat(viewModel.event.value).isNull()
}
- @Test
- fun `given ttp used and feedback not given, when on survey tapped, then navigate to tap to pay feedback screen event emitted`() {
- // GIVEN
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
- whenever(wooStore.getStoreCountryCode(selectedSite.get())).thenReturn("US")
- whenever(tapToPayAvailabilityStatus()).thenReturn(Available)
- whenever(cardReaderCountryConfigProvider.provideCountryConfigFor("US"))
- .thenReturn(CardReaderConfigForUSA)
-
- // WHEN
- initViewModel()
- (viewModel.viewStateData.getOrAwaitValue()).rows.find {
- it.label == UiStringRes(R.string.card_reader_tap_to_pay_share_feedback)
- }!!.onClick!!.invoke()
-
- // THEN
- assertThat(viewModel.event.value).isInstanceOf(NavigateToTapToPaySurveyScreen::class.java)
- }
-
- @Test
- fun `given ttp used and feedback not given, when on survey tapped, then navigate tap is tracked`() {
- // GIVEN
- whenever(feedbackRepository.getFeatureFeedbackSetting(FeatureFeedbackSettings.Feature.TAP_TO_PAY))
- .thenReturn(FeatureFeedbackSettings(FeatureFeedbackSettings.Feature.TAP_TO_PAY))
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
- whenever(wooStore.getStoreCountryCode(selectedSite.get())).thenReturn("US")
- whenever(tapToPayAvailabilityStatus()).thenReturn(Available)
- whenever(cardReaderCountryConfigProvider.provideCountryConfigFor("US"))
- .thenReturn(CardReaderConfigForUSA)
-
- // WHEN
- initViewModel()
- (viewModel.viewStateData.getOrAwaitValue()).rows.find {
- it.label == UiStringRes(R.string.card_reader_tap_to_pay_share_feedback)
- }!!.onClick!!.invoke()
-
- // THEN
- verify(analyticsTrackerWrapper).track(AnalyticsEvent.PAYMENTS_HUB_TAP_TO_PAY_FEEDBACK_TAPPED)
- }
-
- @Test
- fun `given ttp used and feedback not given, when on survey tapped, then save that answer is given`() {
- // GIVEN
- whenever(appPrefs.isTTPWasUsedAtLeastOnce()).thenReturn(true)
- whenever(wooStore.getStoreCountryCode(selectedSite.get())).thenReturn("US")
- whenever(tapToPayAvailabilityStatus()).thenReturn(Available)
- whenever(cardReaderCountryConfigProvider.provideCountryConfigFor("US"))
- .thenReturn(CardReaderConfigForUSA)
-
- // WHEN
- initViewModel()
- (viewModel.viewStateData.getOrAwaitValue()).rows.find {
- it.label == UiStringRes(R.string.card_reader_tap_to_pay_share_feedback)
- }!!.onClick!!.invoke()
-
- // THEN
- verify(feedbackRepository).saveFeatureFeedback(
- FeatureFeedbackSettings.Feature.TAP_TO_PAY,
- FeatureFeedbackSettings.FeedbackState.GIVEN
- )
- }
-
// region optional card reader update
@Test
fun `given card reader not connected, when view model initiated, then do not show the snackbar`() {
@@ -2011,8 +1828,6 @@ class PaymentsHubViewModelTest : BaseUnitTest() {
paymentsFlowTracker,
paymentMenuUtmProvider,
tapToPayAvailabilityStatus,
- appPrefs,
- feedbackRepository,
paymentsHubTapToPayUnavailableHandler,
clearCardReaderDataAction,
cardReaderManager,