Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tap To Pay] Remove first TTP usage survey #13207

Merged
merged 6 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
-----
- [*] 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]
- [*] 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 0 additions & 10 deletions WooCommerce/src/main/kotlin/com/woocommerce/android/AppPrefs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ data class FeatureFeedbackSettings(
PRODUCT_ADDONS,
SIMPLE_PAYMENTS_AND_ORDER_CREATION,
ANALYTICS_HUB,
TAP_TO_PAY,
ORDER_SHIPPING_LINES
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,18 @@ 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
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
Expand Down Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
)
)
}
}
}

Expand All @@ -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) }
)
)
Expand All @@ -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
)
)
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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(
Expand All @@ -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()
Expand Down Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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))
}
}
Expand Down
1 change: 0 additions & 1 deletion WooCommerce/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,6 @@ Language: ar
<string name="card_reader_type_selection_bluetooth_reader_description">يقبل قارئ البطاقات المدفوعات من خلال الضغط والرقائق والسحب باستخدام بطاقات الخصم والائتمان.</string>
<string name="card_reader_type_selection_tap_to_pay_description">اقبل مدفوعات لا حصر لها بأمان وبشكل مباشر من هاتفك.</string>
<string name="card_reader_tap_to_pay_description">استخدم هاتفك لقبول الدفع\nبالبطاقة. جربها الآن.</string>
<string name="card_reader_tap_to_pay_share_feedback">مشاركة ملاحظات</string>
<string name="login_site_credentials_web_authorization_connection_rejected">يتعذر تسجيل الدخول لأن إنشاء كلمة مرور التطبيق غير معتمد.</string>
<string name="login_site_credentials_fetching_site">جارٍ إحضار الموقع…</string>
<string name="login_site_credentials_fetching_site_failed">حدث خطأ في أثناء إحضار موقعك على الويب</string>
Expand Down
1 change: 0 additions & 1 deletion WooCommerce/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,6 @@ Language: de
<string name="login_site_credentials_web_authorization_connection_rejected">Die Anmeldung ist nicht möglich, weil die Erstellung von Anwendungspasswörtern nicht genehmigt wurde.</string>
<string name="login_site_credentials_fetching_site">Website wird abgerufen …</string>
<string name="card_reader_tap_to_pay_description">Nutze dein Mobiltelefon zum Akzeptieren von\nKartenzahlungen. Teste es jetzt.</string>
<string name="card_reader_tap_to_pay_share_feedback">Feedback teilen</string>
<string name="loading">Lädt…</string>
<string name="login_site_credentials_fetching_site_failed">Beim Abrufen der Website ist ein Fehler aufgetreten</string>
<string name="login_site_credentials_use_web_authorization">Versuche es über die WP Admin-Seite erneut</string>
Expand Down
1 change: 0 additions & 1 deletion WooCommerce/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,6 @@ Language: es
<string name="card_reader_type_selection_bluetooth_reader_description">El lector de tarjetas acepta pagos con tarjetas de débito y crédito con toque, chip y banda magnética.</string>
<string name="card_reader_type_selection_tap_to_pay_description">Acepta pagos sin contacto de forma segura directamente desde tu teléfono.</string>
<string name="card_reader_tap_to_pay_description">Utiliza tu teléfono para aceptar pagos con\ntarjeta. Pruébalo ahora.</string>
<string name="card_reader_tap_to_pay_share_feedback">Compartir comentarios</string>
<string name="login_site_credentials_web_authorization_connection_rejected">No se puede acceder porque la creación de la contraseña de la aplicación no está aprobada.</string>
<string name="login_site_credentials_fetching_site">Cargando sitio…</string>
<string name="login_site_credentials_fetching_site_failed">Se ha producido un error al cargar tu sitio web</string>
Expand Down
1 change: 0 additions & 1 deletion WooCommerce/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,6 @@ Language: fr
<string name="card_reader_type_selection_bluetooth_reader_description">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.</string>
<string name="card_reader_type_selection_tap_to_pay_description">Acceptez des paiements sans contact en toute sécurité directement sur votre téléphone.</string>
<string name="card_reader_tap_to_pay_description">Utilisez votre téléphone pour accepter les paiements\npar carte. Essayez dès maintenant.</string>
<string name="card_reader_tap_to_pay_share_feedback">Donner votre avis</string>
<string name="login_site_credentials_web_authorization_connection_rejected">Impossible de se connecter, car le mot de passe créé pour l’application n’est pas approuvé.</string>
<string name="login_site_credentials_fetching_site">Récupération du site…</string>
<string name="login_site_credentials_fetching_site_failed">Une erreur est survenue lors de la récupération de votre site Web</string>
Expand Down
Loading
Loading