Skip to content

Commit

Permalink
APPS-3693: add new behaviour for IAP
Browse files Browse the repository at this point in the history
  • Loading branch information
eadm committed Aug 12, 2023
1 parent d4b5271 commit 5065c53
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ android {

multiDexEnabled true

/**
* Field changes behaviour of Course purchases for different stores
*/
buildConfigField "boolean", "IS_GOOGLE_PLAY", "true"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.stepic.droid.configuration

import org.stepic.droid.BuildConfig

object RemoteConfig {
const val PREFIX = "remote_config_"

Expand All @@ -12,7 +14,12 @@ object RemoteConfig {
const val IS_NEW_HOME_SCREEN_ENABLED = "is_new_home_screen_enabled"
const val PERSONALIZED_ONBOARDING_COURSE_LISTS = "personalized_onboarding_course_lists"
const val IS_COURSE_REVENUE_AVAILABLE_ANDROID = "is_course_revenue_available_android"
const val PURCHASE_FLOW_ANDROID = "purchase_flow_android_1_218_and_later"
val PURCHASE_FLOW_ANDROID =
if (BuildConfig.IS_GOOGLE_PLAY) {
"purchase_flow_android_1_218_and_later"
} else {
"purchase_flow_android"
}
const val PURCHASE_FLOW_ANDROID_TEST = "purchase_flow_android_test"
const val PURCHASE_FLOW_DISCLAIMER_EN = "purchase_flow_android_disclaimer_en"
const val PURCHASE_FLOW_DISCLAIMER_RU = "purchase_flow_android_disclaimer_ru"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.stepic.droid.configuration

import org.stepik.android.remote.auth.model.TokenType
import javax.inject.Inject

class EndpointResolverImpl
@Inject
constructor(
private val config: Config
) : EndpointResolver {
override fun getOAuthClientId(type: TokenType): String =
config.getOAuthClientId(type)

override fun getBaseUrl(): String =
config.baseUrl

override fun getOAuthClientSecret(type: TokenType): String =
config.getOAuthClientSecret(type)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.stepic.droid.util

import android.app.Application
import okhttp3.Interceptor

object DebugToolsHelper {
fun initDebugTools(app: Application) {
// no op
}

fun getDebugInterceptors(): List<Interceptor> =
emptyList()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.stepik.android.view.debug.ui.fragment

import androidx.fragment.app.Fragment

interface DebugMenu {
companion object {
const val TAG = "DebugFragment"
fun newInstance(): Fragment = Fragment()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.stepik.android.view.injection.debug

import dagger.Subcomponent

@Subcomponent
interface DebugComponent {
@Subcomponent.Builder
interface Builder {
fun build(): DebugComponent
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.stepik.android.view.injection.debug

import dagger.Subcomponent

@Subcomponent
interface InAppPurchasesComponent {
@Subcomponent.Builder
interface Builder {
fun build(): InAppPurchasesComponent
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.stepik.android.view.injection.debug

import dagger.Subcomponent

@Subcomponent
interface SplitTestsComponent {
@Subcomponent.Builder
interface Builder {
fun build(): SplitTestsComponent
}
}

0 comments on commit 5065c53

Please sign in to comment.