Skip to content

Commit fe9591d

Browse files
committed
Remove stripe IPP from experiments; always true now
1 parent e94ec2e commit fe9591d

File tree

11 files changed

+6
-163
lines changed

11 files changed

+6
-163
lines changed

Networking/Networking/Model/Copiable/Models+Copiable.generated.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,8 +1741,8 @@ extension WCPayCardPresentPaymentDetails {
17411741
extension WCPayCardPresentReceiptDetails {
17421742
public func copy(
17431743
accountType: CopiableProp<WCPayCardFunding> = .copy,
1744-
applicationPreferredName: CopiableProp<String> = .copy,
1745-
dedicatedFileName: CopiableProp<String> = .copy
1744+
applicationPreferredName: NullableCopiableProp<String> = .copy,
1745+
dedicatedFileName: NullableCopiableProp<String> = .copy
17461746
) -> WCPayCardPresentReceiptDetails {
17471747
let accountType = accountType ?? self.accountType
17481748
let applicationPreferredName = applicationPreferredName ?? self.applicationPreferredName

Storage/Storage/Model/Copiable/Models+Copiable.generated.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ extension GeneralAppSettings {
1010
feedbacks: CopiableProp<[FeedbackType: FeedbackSettings]> = .copy,
1111
isViewAddOnsSwitchEnabled: CopiableProp<Bool> = .copy,
1212
isOrderCreationSwitchEnabled: CopiableProp<Bool> = .copy,
13-
isStripeInPersonPaymentsSwitchEnabled: CopiableProp<Bool> = .copy,
1413
isCanadaInPersonPaymentsSwitchEnabled: CopiableProp<Bool> = .copy,
1514
isProductSKUInputScannerSwitchEnabled: CopiableProp<Bool> = .copy,
1615
isCouponManagementSwitchEnabled: CopiableProp<Bool> = .copy,
@@ -22,7 +21,6 @@ extension GeneralAppSettings {
2221
let feedbacks = feedbacks ?? self.feedbacks
2322
let isViewAddOnsSwitchEnabled = isViewAddOnsSwitchEnabled ?? self.isViewAddOnsSwitchEnabled
2423
let isOrderCreationSwitchEnabled = isOrderCreationSwitchEnabled ?? self.isOrderCreationSwitchEnabled
25-
let isStripeInPersonPaymentsSwitchEnabled = isStripeInPersonPaymentsSwitchEnabled ?? self.isStripeInPersonPaymentsSwitchEnabled
2624
let isCanadaInPersonPaymentsSwitchEnabled = isCanadaInPersonPaymentsSwitchEnabled ?? self.isCanadaInPersonPaymentsSwitchEnabled
2725
let isProductSKUInputScannerSwitchEnabled = isProductSKUInputScannerSwitchEnabled ?? self.isProductSKUInputScannerSwitchEnabled
2826
let isCouponManagementSwitchEnabled = isCouponManagementSwitchEnabled ?? self.isCouponManagementSwitchEnabled
@@ -35,7 +33,6 @@ extension GeneralAppSettings {
3533
feedbacks: feedbacks,
3634
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
3735
isOrderCreationSwitchEnabled: isOrderCreationSwitchEnabled,
38-
isStripeInPersonPaymentsSwitchEnabled: isStripeInPersonPaymentsSwitchEnabled,
3936
isCanadaInPersonPaymentsSwitchEnabled: isCanadaInPersonPaymentsSwitchEnabled,
4037
isProductSKUInputScannerSwitchEnabled: isProductSKUInputScannerSwitchEnabled,
4138
isCouponManagementSwitchEnabled: isCouponManagementSwitchEnabled,

Storage/Storage/Model/GeneralAppSettings.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
2828
///
2929
public let isOrderCreationSwitchEnabled: Bool
3030

31-
/// The state for the Stripe Gateway Extension IPP feature switch
32-
///
33-
public let isStripeInPersonPaymentsSwitchEnabled: Bool
34-
3531
/// The state for the In-Person Payments in Canada feature switch
3632
///
3733
public let isCanadaInPersonPaymentsSwitchEnabled: Bool
@@ -60,7 +56,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
6056
feedbacks: [FeedbackType: FeedbackSettings],
6157
isViewAddOnsSwitchEnabled: Bool,
6258
isOrderCreationSwitchEnabled: Bool,
63-
isStripeInPersonPaymentsSwitchEnabled: Bool,
6459
isCanadaInPersonPaymentsSwitchEnabled: Bool,
6560
isProductSKUInputScannerSwitchEnabled: Bool,
6661
isCouponManagementSwitchEnabled: Bool,
@@ -71,7 +66,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
7166
self.feedbacks = feedbacks
7267
self.isViewAddOnsSwitchEnabled = isViewAddOnsSwitchEnabled
7368
self.isOrderCreationSwitchEnabled = isOrderCreationSwitchEnabled
74-
self.isStripeInPersonPaymentsSwitchEnabled = isStripeInPersonPaymentsSwitchEnabled
7569
self.isCanadaInPersonPaymentsSwitchEnabled = isCanadaInPersonPaymentsSwitchEnabled
7670
self.isProductSKUInputScannerSwitchEnabled = isProductSKUInputScannerSwitchEnabled
7771
self.isCouponManagementSwitchEnabled = isCouponManagementSwitchEnabled
@@ -102,7 +96,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
10296
feedbacks: updatedFeedbacks,
10397
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
10498
isOrderCreationSwitchEnabled: isOrderCreationSwitchEnabled,
105-
isStripeInPersonPaymentsSwitchEnabled: isStripeInPersonPaymentsSwitchEnabled,
10699
isCanadaInPersonPaymentsSwitchEnabled: isCanadaInPersonPaymentsSwitchEnabled,
107100
isProductSKUInputScannerSwitchEnabled: isProductSKUInputScannerSwitchEnabled,
108101
isCouponManagementSwitchEnabled: isCouponManagementSwitchEnabled,
@@ -123,7 +116,6 @@ extension GeneralAppSettings {
123116
self.feedbacks = try container.decodeIfPresent([FeedbackType: FeedbackSettings].self, forKey: .feedbacks) ?? [:]
124117
self.isViewAddOnsSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isViewAddOnsSwitchEnabled) ?? false
125118
self.isOrderCreationSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isOrderCreationSwitchEnabled) ?? false
126-
self.isStripeInPersonPaymentsSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isStripeInPersonPaymentsSwitchEnabled) ?? false
127119
self.isCanadaInPersonPaymentsSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isCanadaInPersonPaymentsSwitchEnabled) ?? false
128120
self.isProductSKUInputScannerSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isProductSKUInputScannerSwitchEnabled) ?? false
129121
self.isCouponManagementSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isCouponManagementSwitchEnabled) ?? false

Storage/StorageTests/Model/AppSettings/GeneralAppSettingsTests.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ final class GeneralAppSettingsTests: XCTestCase {
6262
feedbacks: feedbackSettings,
6363
isViewAddOnsSwitchEnabled: true,
6464
isOrderCreationSwitchEnabled: true,
65-
isStripeInPersonPaymentsSwitchEnabled: true,
6665
isCanadaInPersonPaymentsSwitchEnabled: true,
6766
isProductSKUInputScannerSwitchEnabled: true,
6867
isCouponManagementSwitchEnabled: true,
@@ -85,7 +84,6 @@ final class GeneralAppSettingsTests: XCTestCase {
8584
assertEqual(newSettings.lastEligibilityErrorInfo, eligibilityInfo)
8685
assertEqual(newSettings.isViewAddOnsSwitchEnabled, false)
8786
assertEqual(newSettings.isOrderCreationSwitchEnabled, true)
88-
assertEqual(newSettings.isStripeInPersonPaymentsSwitchEnabled, true)
8987
assertEqual(newSettings.isCanadaInPersonPaymentsSwitchEnabled, true)
9088
assertEqual(newSettings.isProductSKUInputScannerSwitchEnabled, true)
9189
assertEqual(newSettings.isCouponManagementSwitchEnabled, true)
@@ -98,7 +96,6 @@ private extension GeneralAppSettingsTests {
9896
feedbacks: [FeedbackType: FeedbackSettings] = [:],
9997
isViewAddOnsSwitchEnabled: Bool = false,
10098
isOrderCreationSwitchEnabled: Bool = false,
101-
isStripeInPersonPaymentsSwitchEnabled: Bool = false,
10299
isCanadaInPersonPaymentsSwitchEnabled: Bool = false,
103100
isProductSKUInputScannerSwitchEnabled: Bool = false,
104101
isCouponManagementSwitchEnabled: Bool = false,
@@ -109,7 +106,6 @@ private extension GeneralAppSettingsTests {
109106
feedbacks: feedbacks,
110107
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
111108
isOrderCreationSwitchEnabled: isOrderCreationSwitchEnabled,
112-
isStripeInPersonPaymentsSwitchEnabled: isStripeInPersonPaymentsSwitchEnabled,
113109
isCanadaInPersonPaymentsSwitchEnabled: isCanadaInPersonPaymentsSwitchEnabled,
114110
isProductSKUInputScannerSwitchEnabled: isProductSKUInputScannerSwitchEnabled,
115111
isCouponManagementSwitchEnabled: isCouponManagementSwitchEnabled,

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Beta features/BetaFeaturesViewController.swift

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ private extension BetaFeaturesViewController {
9494
func inPersonPaymentsSection() -> Section? {
9595
var rows: [Row] = []
9696

97-
if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.stripeExtensionInPersonPayments) {
98-
rows += [.stripeExtensionInPersonPayments, .stripeExtensionInPersonPaymentsDescription]
99-
}
100-
10197
if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.canadaInPersonPayments) {
10298
rows += [.canadaInPersonPayments, .canadaInPersonPaymentsDescription]
10399
}
@@ -153,11 +149,6 @@ private extension BetaFeaturesViewController {
153149
configureOrderCreationSwitch(cell: cell)
154150
case let cell as BasicTableViewCell where row == .orderCreationDescription:
155151
configureOrderCreationDescription(cell: cell)
156-
// WooCommerce Stripe Payment Gateway extension In-Person Payments
157-
case let cell as SwitchTableViewCell where row == .stripeExtensionInPersonPayments:
158-
configureStripeExtensionInPersonPaymentsSwitch(cell: cell)
159-
case let cell as BasicTableViewCell where row == .stripeExtensionInPersonPaymentsDescription:
160-
configureStripeExtensionInPersonPaymentsDescription(cell: cell)
161152
// In-Person Payments in Canada
162153
case let cell as SwitchTableViewCell where row == .canadaInPersonPayments:
163154
configureCanadaInPersonPaymentsSwitch(cell: cell)
@@ -243,37 +234,6 @@ private extension BetaFeaturesViewController {
243234
cell.textLabel?.text = Localization.orderCreationDescription
244235
}
245236

246-
func configureStripeExtensionInPersonPaymentsSwitch(cell: SwitchTableViewCell) {
247-
configureCommonStylesForSwitchCell(cell)
248-
cell.title = Localization.stripeExtensionInPersonPaymentsTitle
249-
250-
// Fetch switch's state stored value.
251-
let action = AppSettingsAction.loadStripeInPersonPaymentsSwitchState { result in
252-
guard let isEnabled = try? result.get() else {
253-
return cell.isOn = false
254-
}
255-
cell.isOn = isEnabled
256-
}
257-
ServiceLocator.stores.dispatch(action)
258-
259-
// Change switch's state stored value
260-
cell.onChange = { isSwitchOn in
261-
let action = AppSettingsAction.setStripeInPersonPaymentsSwitchState(isEnabled: isSwitchOn, onCompletion: { result in
262-
// Roll back toggle if an error occurred
263-
if result.isFailure {
264-
cell.isOn.toggle()
265-
}
266-
})
267-
ServiceLocator.stores.dispatch(action)
268-
}
269-
cell.accessibilityIdentifier = "beta-features-stripe-extension-in-person-payments-cell"
270-
}
271-
272-
func configureStripeExtensionInPersonPaymentsDescription(cell: BasicTableViewCell) {
273-
configureCommonStylesForDescriptionCell(cell)
274-
cell.textLabel?.text = Localization.stripeExtensionInPersonPaymentsDescription
275-
}
276-
277237
func configureCanadaInPersonPaymentsSwitch(cell: SwitchTableViewCell) {
278238
configureCommonStylesForSwitchCell(cell)
279239
cell.title = Localization.canadaExtensionInPersonPaymentsTitle
@@ -434,10 +394,6 @@ private enum Row: CaseIterable {
434394
case orderCreation
435395
case orderCreationDescription
436396

437-
// WooCommerce Stripe Payment Gateway extension In-Person Payments
438-
case stripeExtensionInPersonPayments
439-
case stripeExtensionInPersonPaymentsDescription
440-
441397
// In-Person Payments in Canada
442398
case canadaInPersonPayments
443399
case canadaInPersonPaymentsDescription
@@ -452,9 +408,9 @@ private enum Row: CaseIterable {
452408

453409
var type: UITableViewCell.Type {
454410
switch self {
455-
case .orderAddOns, .orderCreation, .stripeExtensionInPersonPayments, .canadaInPersonPayments, .productSKUInputScanner, .couponManagement:
411+
case .orderAddOns, .orderCreation, .canadaInPersonPayments, .productSKUInputScanner, .couponManagement:
456412
return SwitchTableViewCell.self
457-
case .orderAddOnsDescription, .orderCreationDescription, .stripeExtensionInPersonPaymentsDescription, .canadaInPersonPaymentsDescription,
413+
case .orderAddOnsDescription, .orderCreationDescription, .canadaInPersonPaymentsDescription,
458414
.productSKUInputScannerDescription, .couponManagementDescription:
459415
return BasicTableViewCell.self
460416
}
@@ -481,15 +437,6 @@ private extension BetaFeaturesViewController {
481437
"Test out creating new manual orders as we get ready to launch",
482438
comment: "Cell description on the beta features screen to enable creating new orders")
483439

484-
static let stripeExtensionInPersonPaymentsTitle = NSLocalizedString(
485-
"IPP with Stripe extension",
486-
comment: "Cell title on beta features screen to enable accepting in-person payments for stores with the " +
487-
"WooCommerce Stripe Payment Gateway extension")
488-
static let stripeExtensionInPersonPaymentsDescription = NSLocalizedString(
489-
"Test out In-Person Payments with the Stripe Payment Gateway extension",
490-
comment: "Cell description on beta features screen to enable accepting in-person payments for stores with " +
491-
"the WooCommerce Stripe Payment Gateway extension")
492-
493440
static let canadaExtensionInPersonPaymentsTitle = NSLocalizedString(
494441
"In-Person Payments in Canada",
495442
comment: "Cell title on beta features screen to enable accepting in-person payments for stores in Canada ")

WooCommerce/Classes/ViewRelated/Dashboard/Settings/In-Person Payments/CardPresentPaymentsOnboardingUseCase.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ protocol CardPresentPaymentsOnboardingUseCaseProtocol {
3030
final class CardPresentPaymentsOnboardingUseCase: CardPresentPaymentsOnboardingUseCaseProtocol, ObservableObject {
3131
let storageManager: StorageManagerType
3232
let stores: StoresManager
33-
private var stripeGatewayIPPEnabled: Bool = false
3433
private var canadaIPPEnabled: Bool = false
3534

3635
@Published var state: CardPresentPaymentOnboardingState = .loading
@@ -46,16 +45,6 @@ final class CardPresentPaymentsOnboardingUseCase: CardPresentPaymentsOnboardingU
4645
self.storageManager = storageManager
4746
self.stores = stores
4847

49-
let stripeAction = AppSettingsAction.loadStripeInPersonPaymentsSwitchState(onCompletion: { [weak self] result in
50-
switch result {
51-
case .success(let stripeGatewayIPPEnabled):
52-
self?.stripeGatewayIPPEnabled = stripeGatewayIPPEnabled
53-
default:
54-
break
55-
}
56-
})
57-
stores.dispatch(stripeAction)
58-
5948
let canadaAction = AppSettingsAction.loadCanadaInPersonPaymentsSwitchState(onCompletion: { [weak self] result in
6049
switch result {
6150
case .success(let canadaIPPEnabled):
@@ -165,7 +154,6 @@ private extension CardPresentPaymentsOnboardingUseCase {
165154
do {
166155
configuration = try CardPresentPaymentsConfiguration(
167156
country: countryCode,
168-
stripeEnabled: stripeGatewayIPPEnabled,
169157
canadaEnabled: canadaIPPEnabled
170158
)
171159
} catch is CardPresentPaymentsConfigurationMissingError {

Yosemite/Yosemite/Actions/AppSettingsAction.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,6 @@ public enum AppSettingsAction: Action {
128128
///
129129
case setOrderCreationFeatureSwitchState(isEnabled: Bool, onCompletion: (Result<Void, Error>) -> Void)
130130

131-
/// Loads the most recent state for the WooCommerce Stripe Payment Gateway extension In-Person Payments beta feature switch
132-
///
133-
case loadStripeInPersonPaymentsSwitchState(onCompletion: (Result<Bool, Error>) -> Void)
134-
135-
/// Sets the state for the WooCommerce Stripe Payment Gateway extension In-Person Payments beta feature switch
136-
///
137-
case setStripeInPersonPaymentsSwitchState(isEnabled: Bool, onCompletion: (Result<Void, Error>) -> Void)
138-
139131
/// Loads the most recent state for the In-Person Payments in Canada beta feature switch
140132
///
141133
case loadCanadaInPersonPaymentsSwitchState(onCompletion: (Result<Bool, Error>) -> Void)

Yosemite/Yosemite/Model/Payments/CardPresentPaymentsConfiguration.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,14 @@ public struct CardPresentPaymentsConfiguration {
1111
self.paymentGateways = paymentGateways
1212
}
1313

14-
public init(country: String, stripeEnabled: Bool, canadaEnabled: Bool) throws {
14+
public init(country: String, canadaEnabled: Bool) throws {
1515
switch country {
16-
case "US" where stripeEnabled == true:
16+
case "US":
1717
self.init(
1818
paymentMethods: [.cardPresent],
1919
currencies: ["USD"],
2020
paymentGateways: [WCPayAccount.gatewayID, StripeAccount.gatewayID]
2121
)
22-
case "US" where stripeEnabled == false:
23-
self.init(
24-
paymentMethods: [.cardPresent],
25-
currencies: ["USD"],
26-
paymentGateways: [WCPayAccount.gatewayID]
27-
)
2822
case "CA" where canadaEnabled == true:
2923
self.init(
3024
paymentMethods: [.cardPresent, .interacPresent],

Yosemite/Yosemite/Stores/AppSettingsStore.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,6 @@ public class AppSettingsStore: Store {
193193
getSimplePaymentsTaxesToggleState(siteID: siteID, onCompletion: onCompletion)
194194
case .resetGeneralStoreSettings:
195195
resetGeneralStoreSettings()
196-
case .loadStripeInPersonPaymentsSwitchState(onCompletion: let onCompletion):
197-
loadStripeInPersonPaymentsSwitchState(onCompletion: onCompletion)
198-
case .setStripeInPersonPaymentsSwitchState(isEnabled: let isEnabled, onCompletion: let onCompletion):
199-
setStripeInPersonPaymentsSwitchState(isEnabled: isEnabled, onCompletion: onCompletion)
200196
case .loadCanadaInPersonPaymentsSwitchState(onCompletion: let onCompletion):
201197
loadCanadaInPersonPaymentsSwitchState(onCompletion: onCompletion)
202198
case .setCanadaInPersonPaymentsSwitchState(isEnabled: let isEnabled, onCompletion: let onCompletion):
@@ -304,25 +300,6 @@ private extension AppSettingsStore {
304300

305301
}
306302

307-
/// Loads the current WooCommerce Stripe Payment Gateway extension In-Person Payments beta feature switch state from `GeneralAppSettings`
308-
///
309-
func loadStripeInPersonPaymentsSwitchState(onCompletion: (Result<Bool, Error>) -> Void) {
310-
let settings = loadOrCreateGeneralAppSettings()
311-
onCompletion(.success(settings.isStripeInPersonPaymentsSwitchEnabled))
312-
}
313-
314-
/// Sets the provided WooCommerce Stripe Payment Gateway extension In-Person Payments beta feature switch state into `GeneralAppSettings`
315-
///
316-
func setStripeInPersonPaymentsSwitchState(isEnabled: Bool, onCompletion: (Result<Void, Error>) -> Void) {
317-
do {
318-
let settings = loadOrCreateGeneralAppSettings().copy(isStripeInPersonPaymentsSwitchEnabled: isEnabled)
319-
try saveGeneralAppSettings(settings)
320-
onCompletion(.success(()))
321-
} catch {
322-
onCompletion(.failure(error))
323-
}
324-
}
325-
326303
/// Loads the current In-Person Payments in Canada beta feature switch state from `GeneralAppSettings`
327304
///
328305
func loadCanadaInPersonPaymentsSwitchState(onCompletion: (Result<Bool, Error>) -> Void) {
@@ -437,7 +414,6 @@ private extension AppSettingsStore {
437414
feedbacks: [:],
438415
isViewAddOnsSwitchEnabled: false,
439416
isOrderCreationSwitchEnabled: false,
440-
isStripeInPersonPaymentsSwitchEnabled: false,
441417
isCanadaInPersonPaymentsSwitchEnabled: false,
442418
isProductSKUInputScannerSwitchEnabled: false,
443419
isCouponManagementSwitchEnabled: false,

0 commit comments

Comments
 (0)