From 2ce2aad6c67f50bbb946d5d44850be2d98fc3bf7 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Fri, 23 Feb 2024 12:31:12 +0530 Subject: [PATCH] Revert "Switch to stripe for all" This reverts commit 9a1e8da5007b65ecc4a361c5277b2f909015337d. --- lib/ui/payment/subscription.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ui/payment/subscription.dart b/lib/ui/payment/subscription.dart index 067a3ae102..0327c3ab53 100644 --- a/lib/ui/payment/subscription.dart +++ b/lib/ui/payment/subscription.dart @@ -1,4 +1,5 @@ import 'package:flutter/cupertino.dart'; +import 'package:photos/core/configuration.dart'; import 'package:photos/services/feature_flag_service.dart'; import 'package:photos/services/update_service.dart'; import "package:photos/ui/payment/store_subscription_page.dart"; @@ -8,9 +9,18 @@ StatefulWidget getSubscriptionPage({bool isOnBoarding = false}) { if (UpdateService.instance.isIndependentFlavor()) { return StripeSubscriptionPage(isOnboarding: isOnBoarding); } - if (FeatureFlagService.instance.enableStripe()) { + if (FeatureFlagService.instance.enableStripe() && + _isUserCreatedPostStripeSupport()) { return StripeSubscriptionPage(isOnboarding: isOnBoarding); } else { return StoreSubscriptionPage(isOnboarding: isOnBoarding); } } + +// return true if the user was created after we added support for stripe payment +// on frame. We do this check to avoid showing Stripe payment option for earlier +// users who might have paid via playStore. This method should be removed once +// we have better handling for active play/app store subscription & stripe plans. +bool _isUserCreatedPostStripeSupport() { + return Configuration.instance.getUserID()! > 1580559962386460; +}