@@ -120,6 +120,10 @@ final class OrderListViewController: UIViewController, GhostableViewController {
120120 ///
121121 private var swipeActionsGlanced = false
122122
123+ /// Banner variation that will be shown as In-Person Payments feedback banner. If any.
124+ ///
125+ private var inPersonPaymentsSurveyVariation : SurveyViewController . Source ?
126+
123127
124128 // MARK: - View Lifecycle
125129
@@ -158,7 +162,7 @@ final class OrderListViewController: UIViewController, GhostableViewController {
158162 configureSyncingCoordinator ( )
159163
160164 if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . IPPInAppFeedbackBanner) {
161- viewModel. displayIPPFeedbackBannerIfEligible ( )
165+ inPersonPaymentsSurveyVariation = viewModel. feedbackBannerSurveySource ( )
162166 }
163167 }
164168
@@ -255,7 +259,10 @@ private extension OrderListViewController {
255259 case . orderCreation:
256260 self . setOrderCreationTopBanner ( )
257261 case . IPPFeedback:
258- self . setIPPFeedbackTopBanner ( )
262+ guard let survey = self . inPersonPaymentsSurveyVariation else {
263+ return
264+ }
265+ self . setIPPFeedbackTopBanner ( survey: survey)
259266 }
260267 }
261268 . store ( in: & cancellables)
@@ -353,6 +360,7 @@ extension OrderListViewController: SyncingCoordinatorDelegate {
353360
354361 transitionToSyncingState ( )
355362 viewModel. hasErrorLoadingData = false
363+ viewModel. updateBannerVisibility ( )
356364
357365 let action = viewModel. synchronizationAction (
358366 siteID: siteID,
@@ -788,19 +796,36 @@ private extension OrderListViewController {
788796
789797 /// Sets the `topBannerView` property to an IPP feedback banner.
790798 ///
791- func setIPPFeedbackTopBanner( ) {
792- topBannerView = createIPPFeedbackTopBanner ( )
799+ func setIPPFeedbackTopBanner( survey : SurveyViewController . Source ) {
800+ topBannerView = createIPPFeedbackTopBanner ( survey : survey )
793801 showTopBannerView ( )
794802 }
795803
796- private func createIPPFeedbackTopBanner( ) -> TopBannerView {
804+ private func createIPPFeedbackTopBanner( survey : SurveyViewController . Source ) -> TopBannerView {
797805 let shareIPPFeedbackAction = TopBannerViewModel . ActionButton ( title: Localization . shareFeedbackButton, action: { _ in
798- self . displayIPPFeedbackBannerSurvey ( )
806+ self . displayIPPFeedbackBannerSurvey ( survey : survey )
799807 } )
800808
809+ var bannerTitle = " "
810+ var bannerText = " "
811+
812+ switch survey {
813+ case . IPP_COD :
814+ bannerTitle = Localization . inPersonPaymentsCashOnDeliveryBannerTitle
815+ bannerText = Localization . inPersonPaymentsCashOnDeliveryBannerContent
816+ case . IPP_firstTransaction:
817+ bannerTitle = Localization . inPersonPaymentsFirstTransactionBannerTitle
818+ bannerTitle = Localization . inPersonPaymentsFirstTransactionBannerContent
819+ case . IPP_powerUsers:
820+ bannerTitle = Localization . inPersonPaymentsPowerUsersBannerTitle
821+ bannerTitle = Localization . inPersonPaymentsPowerUsersBannerContent
822+ default :
823+ break
824+ }
825+
801826 let viewModel = TopBannerViewModel (
802- title: Localization . feedbackBannerTitle ,
803- infoText: Localization . feedbackBannerContent ,
827+ title: bannerTitle ,
828+ infoText: bannerText ,
804829 icon: UIImage . gridicon ( . comment) ,
805830 isExpanded: true ,
806831 topButton: . dismiss( handler: { } ) ,
@@ -811,9 +836,8 @@ private extension OrderListViewController {
811836 return topBannerView
812837 }
813838
814- private func displayIPPFeedbackBannerSurvey( ) {
815- // TODO: Survey will change based on conditions
816- let surveyNavigation = SurveyCoordinatingController ( survey: . IPPFeedback)
839+ private func displayIPPFeedbackBannerSurvey( survey: SurveyViewController . Source ) {
840+ let surveyNavigation = SurveyCoordinatingController ( survey: survey)
817841 self . present ( surveyNavigation, animated: true , completion: nil )
818842 }
819843}
@@ -834,14 +858,30 @@ private extension OrderListViewController {
834858
835859 static let markCompleted = NSLocalizedString ( " Mark Completed " , comment: " Title for the swipe order action to mark it as completed " )
836860
837- static let feedbackBannerTitle = NSLocalizedString ( " Let us know what you think " ,
861+ static let inPersonPaymentsCashOnDeliveryBannerTitle = NSLocalizedString ( " Let us know how we can help " ,
838862 comment: " Title of the In-Person Payments feedback banner in the Orders tab "
839863 )
840864
841- static let feedbackBannerContent = NSLocalizedString ( " Rate your In-Person Payment experience. " ,
865+ static let inPersonPaymentsFirstTransactionBannerTitle = NSLocalizedString ( " Enjoyed your in-person payment? " ,
866+ comment: " Title of the In-Person Payments feedback banner in the Orders tab "
867+ )
868+
869+ static let inPersonPaymentsPowerUsersBannerTitle = NSLocalizedString ( " Let us know what you think " ,
870+ comment: " Title of the In-Person Payments feedback banner in the Orders tab "
871+ )
872+
873+ static let inPersonPaymentsCashOnDeliveryBannerContent = NSLocalizedString ( " Share your own experience or how you collect in-person payments. " ,
842874 comment: " Content of the In-Person Payments feedback banner in the Orders tab "
843875 )
844876
877+ static let inPersonPaymentsFirstTransactionBannerContent = NSLocalizedString ( " Rate your first in-person payment experience. " ,
878+ comment: " Content of the In-Person Payments feedback banner in the Orders tab "
879+ )
880+
881+ static let inPersonPaymentsPowerUsersBannerContent = NSLocalizedString ( " Tell us all about your experience with in-person payments. " ,
882+ comment: " Content of the In-Person Payments feedback banner in the Orders tab "
883+ )
884+
845885 static let shareFeedbackButton = NSLocalizedString ( " Share feedback " ,
846886 comment: " Title of the feedback action button on the In-Person Payments feedback banner "
847887 )
0 commit comments