Skip to content

Commit 6d929a0

Browse files
authored
Merge pull request #8814 from woocommerce/issue/8773-reveal-TTP-feature-toggle-in-release-builds
[Mobile Payments] Reveal TTP feature toggle in release builds
2 parents 1a933ad + ff484c1 commit 6d929a0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
5656
// Disabled by default to avoid costs spikes, unless in internal testing builds.
5757
return buildConfig == .alpha
5858
case .tapToPayOnIPhone:
59-
return buildConfig == .localDeveloper
59+
// It is not possible to get the TTPoI entitlement for an enterprise certificate,
60+
// so we should not enable this for alpha builds.
61+
return buildConfig == .localDeveloper || buildConfig == .appStore
6062
case .domainSettings:
6163
return buildConfig == .localDeveloper || buildConfig == .alpha
6264
case .supportRequests:

WooCommerce/Classes/Model/BetaFeature.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,22 @@ extension BetaFeature {
7070
case .inAppPurchases:
7171
return ServiceLocator.featureFlagService.isFeatureFlagEnabled(.inAppPurchases)
7272
case .tapToPayOnIPhone:
73-
return ServiceLocator.featureFlagService.isFeatureFlagEnabled(.tapToPayOnIPhone)
73+
return ServiceLocator.featureFlagService.isFeatureFlagEnabled(.tapToPayOnIPhone) && deviceMaySupportTTP
7474
default:
7575
return true
7676
}
7777
}
7878

79+
// Full checking for support of TTP requires a more complicated call.
80+
// This is sufficient for whether the feature toggle should be shown, as full support checks
81+
// are done when a payment is started. This is a temporary measure until full release.
82+
private var deviceMaySupportTTP: Bool {
83+
guard #available(iOS 16, *) else {
84+
return false
85+
}
86+
return !UIDevice.isPad()
87+
}
88+
7989
static var availableFeatures: [Self] {
8090
allCases.filter(\.isAvailable)
8191
}

0 commit comments

Comments
 (0)