Skip to content

Commit 7bafaf3

Browse files
Add purchase flow test flag
1 parent 6e9aef5 commit 7bafaf3

7 files changed

Lines changed: 16 additions & 14 deletions

File tree

app/src/main/java/org/stepic/droid/configuration/RemoteConfig.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ object RemoteConfig {
1313
const val PERSONALIZED_ONBOARDING_COURSE_LISTS = "personalized_onboarding_course_lists"
1414
const val IS_COURSE_REVENUE_AVAILABLE_ANDROID = "is_course_revenue_available_android"
1515
const val PURCHASE_FLOW_ANDROID = "purchase_flow_android"
16+
const val PURCHASE_FLOW_ANDROID_TEST = "purchase_flow_android_test"
1617
const val PURCHASE_FLOW_DISCLAIMER_EN = "purchase_flow_android_disclaimer_en"
1718
const val PURCHASE_FLOW_DISCLAIMER_RU = "purchase_flow_android_disclaimer_ru"
1819
const val PURCHASE_FLOW_DISCLAIMER_BE = "purchase_flow_android_disclaimer_be"
19-
20-
// TODO APPS-3443: Remove after finishing feature
21-
const val PURCHASE_FLOW_ANDROID_TESTING_FLAG = false
2220
}

app/src/main/java/org/stepik/android/domain/course/interactor/CourseInteractor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ constructor(
5757

5858
private fun obtainCourseHeaderData(course: Course, promo: String? = null): Maybe<CourseHeaderData> {
5959
val currentFlow = CoursePurchaseFlow.valueOfWithFallback(
60-
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID]
60+
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID_TEST]
6161
.asString()
6262
.uppercase()
6363
)
6464

6565
val isInAppActive =
66-
currentFlow.isInAppActive() || RemoteConfig.PURCHASE_FLOW_ANDROID_TESTING_FLAG
66+
currentFlow.isInAppActive()
6767

6868
return zip(
6969
if (isInAppActive) {

app/src/main/java/org/stepik/android/domain/course/interactor/CourseStatsInteractor.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ constructor(
4848

4949
fun checkDeeplinkPromoCodeValidity(courseId: Long, promo: String): Single<Pair<DeeplinkPromoCode, PromoCodeSku>> {
5050
val currentFlow = CoursePurchaseFlow.valueOfWithFallback(
51-
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID]
51+
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID_TEST]
5252
.asString()
5353
.uppercase()
5454
)
5555

56-
val isInAppActive = currentFlow.isInAppActive() || RemoteConfig.PURCHASE_FLOW_ANDROID_TESTING_FLAG
56+
val isInAppActive = currentFlow.isInAppActive()
5757

5858
return coursePaymentsRepository
5959
.checkDeeplinkPromoCodeValidity(courseId, promo)
@@ -232,7 +232,7 @@ constructor(
232232
private fun resolvePaidEnrollmentState(standardLightSku: LightSku?, promoLightSku: LightSku?): EnrollmentState =
233233
if (standardLightSku == null) {
234234
val currentFlow = CoursePurchaseFlow.valueOfWithFallback(
235-
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID]
235+
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID_TEST]
236236
.asString()
237237
.uppercase()
238238
)

app/src/main/java/org/stepik/android/domain/course_list/interactor/CourseListInteractor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ constructor(
6868
sourceTypeComposition: SourceTypeComposition
6969
): Single<PagedList<CourseListItem.Data>> {
7070
val currentFlow = CoursePurchaseFlow.valueOfWithFallback(
71-
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID]
71+
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID_TEST]
7272
.asString()
7373
.uppercase()
7474
)
7575

76-
val isInAppActive = currentFlow.isInAppActive() || RemoteConfig.PURCHASE_FLOW_ANDROID_TESTING_FLAG
76+
val isInAppActive = currentFlow.isInAppActive()
7777

7878
return if (isInAppActive) {
7979
mapCourseStats(

app/src/main/java/org/stepik/android/domain/lesson_demo/interactor/LessonDemoInteractor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ constructor(
2828
) {
2929
fun getLessonDemoData(course: Course): Single<LessonDemoData> {
3030
val currentFlow = CoursePurchaseFlow.valueOfWithFallback(
31-
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID]
31+
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID_TEST]
3232
.asString()
3333
.uppercase()
3434
)
3535

3636
val isInAppActive =
37-
currentFlow.isInAppActive() || RemoteConfig.PURCHASE_FLOW_ANDROID_TESTING_FLAG
37+
currentFlow.isInAppActive()
3838

3939
val deeplinkPromoCode = coursePurchaseDataRepository.getDeeplinkPromoCode()
4040
val initialCoursePurchaseDataResult = coursePurchaseDataRepository.getCoursePurchaseData()

app/src/main/java/org/stepik/android/view/lesson_demo/ui/dialog/LessonDemoCompleteBottomSheetDialogFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ class LessonDemoCompleteBottomSheetDialogFragment :
114114
override fun onAction(action: LessonDemoFeature.Action.ViewAction) {
115115
if (action is LessonDemoFeature.Action.ViewAction.BuyAction) {
116116
val currentFlow = CoursePurchaseFlow.valueOfWithFallback(
117-
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID]
117+
firebaseRemoteConfig[RemoteConfig.PURCHASE_FLOW_ANDROID_TEST]
118118
.asString()
119119
.uppercase()
120120
)
121121

122122
val isInAppActive =
123-
currentFlow.isInAppActive() || RemoteConfig.PURCHASE_FLOW_ANDROID_TESTING_FLAG
123+
currentFlow.isInAppActive()
124124

125125
if (isInAppActive && action.coursePurchaseData != null) {
126126
CoursePurchaseBottomSheetDialogFragment

app/src/main/res/xml/remote_config_defaults.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
<key>purchase_flow_android</key>
4141
<value>web</value>
4242
</entry>
43+
<entry>
44+
<key>purchase_flow_android_test</key>
45+
<value>web</value>
46+
</entry>
4347
<entry>
4448
<key>purchase_flow_android_disclaimer_en</key>
4549
<value><![CDATA[The price includes commission from Google Play and VAT. By paying for access to this course you agree to the <a href="https://welcome.stepik.org/en/payment-terms">user agreement</a>.]]></value>

0 commit comments

Comments
 (0)