@@ -28,6 +28,8 @@ final class CardPresentModalSelectSearchType: CardPresentPaymentsModalViewModel
2828
2929 private var bluetoothProximityAction : ( ( ) -> Void )
3030
31+ private var cancelAction : ( ( ) -> Void )
32+
3133 func didTapPrimaryButton( in viewController: UIViewController ? ) {
3234 tapOnIphoneAction ( )
3335 }
@@ -37,16 +39,20 @@ final class CardPresentModalSelectSearchType: CardPresentPaymentsModalViewModel
3739 }
3840
3941 func didTapAuxiliaryButton( in viewController: UIViewController ? ) {
40- //no-op
42+ cancelAction ( )
4143 }
4244
43- init ( tapOnIPhoneAction: @escaping ( ) -> Void , bluetoothAction: @escaping ( ) -> Void ) {
45+ init ( tapOnIPhoneAction: @escaping ( ) -> Void ,
46+ bluetoothAction: @escaping ( ) -> Void ,
47+ cancelAction: @escaping ( ) -> Void ) {
4448 textMode = . fullInfo
45- actionsMode = . twoAction
49+ actionsMode = . twoActionAndAuxiliary
4650 primaryButtonTitle = CardReaderDiscoveryMethod . localMobile. name
4751 self . tapOnIphoneAction = tapOnIPhoneAction
4852 secondaryButtonTitle = CardReaderDiscoveryMethod . bluetoothProximity. name
4953 self . bluetoothProximityAction = bluetoothAction
54+ auxiliaryButtonTitle = Localization . cancel
55+ self . cancelAction = cancelAction
5056 }
5157}
5258
@@ -61,6 +67,10 @@ private extension CardPresentModalSelectSearchType {
6167 " Your iPhone can be used as a card reader, or you can connect to an external reader via bluetooth. " ,
6268 comment: " The description on the alert shown when connecting a card reader, asking the user to choose a " +
6369 " reader type. Only shown when supported on their device. " )
70+
71+ static let cancel = NSLocalizedString (
72+ " Cancel " ,
73+ comment: " Cancel button title " )
6474 }
6575}
6676
0 commit comments