@@ -85,6 +85,10 @@ struct SimplePaymentsAmount: View {
8585 ///
8686 @ObservedObject private( set) var viewModel : SimplePaymentsAmountViewModel
8787
88+ /// Tracks if the summary view should be presented.
89+ ///
90+ @State private var showSummaryView : Bool = false
91+
8892 var body : some View {
8993 VStack ( alignment: . center, spacing: Layout . mainVerticalSpacing) {
9094
@@ -104,11 +108,19 @@ struct SimplePaymentsAmount: View {
104108 Spacer ( )
105109
106110 // Done button
107- Button ( Localization . buttonTitle) {
108- viewModel. createSimplePaymentsOrder ( )
111+ Button ( Localization . buttonTitle ( ) ) {
112+ if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . simplePaymentsPrototype) {
113+ showSummaryView. toggle ( )
114+ } else {
115+ viewModel. createSimplePaymentsOrder ( )
116+ }
109117 }
110118 . buttonStyle ( PrimaryLoadingButtonStyle ( isLoading: viewModel. loading) )
111119 . disabled ( viewModel. shouldDisableDoneButton)
120+
121+ LazyNavigationLink ( destination: SimplePaymentsSummary ( noteContent: nil ) , isActive: $showSummaryView) {
122+ EmptyView ( )
123+ }
112124 }
113125 . padding ( )
114126 . navigationTitle ( Localization . title)
@@ -128,9 +140,16 @@ private extension SimplePaymentsAmount {
128140 enum Localization {
129141 static let title = NSLocalizedString ( " Take Payment " , comment: " Title for the simple payments screen " )
130142 static let instructions = NSLocalizedString ( " Enter Amount " , comment: " Short instructions label in the simple payments screen " )
131- static let buttonTitle = NSLocalizedString ( " Done " , comment: " Title for the button to confirm the amount in the simple payments screen " )
132143 static let cancelTitle = NSLocalizedString ( " Cancel " , comment: " Title for the button to cancel the simple payments screen " )
133144 static let error = NSLocalizedString ( " There was an error creating the order " , comment: " Notice text after failing to create a simple payments order. " )
145+
146+ static func buttonTitle( ) -> String {
147+ if ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . simplePaymentsPrototype) {
148+ return NSLocalizedString ( " Next " , comment: " Title for the button to confirm the amount in the simple payments screen " )
149+ } else {
150+ return NSLocalizedString ( " Done " , comment: " Title for the button to confirm the amount in the simple payments screen " )
151+ }
152+ }
134153 }
135154
136155 enum Layout {
0 commit comments