Skip to content

Commit

Permalink
bugfix: used stripe product id instead of product alias to check tria…
Browse files Browse the repository at this point in the history
…l config flag
  • Loading branch information
vihangpatil committed Nov 8, 2023
1 parent b9e96eb commit 6b56e14
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ object StripeClient {

private val isProd by lazy { System.getenv("GCP_PROJECT_ID").endsWith("prod", ignoreCase = true) }

val productMap: Map<String, ProductConfig> by loadConfig(
private val productMap: Map<String, ProductConfig> by loadConfig(
"researchApp",
"apps.research.products",
)
Expand Down Expand Up @@ -136,7 +136,7 @@ object StripeClient {
.build()
)
} else {
if (productMap[productId]?.stripeProduct?.enableTrial == true
if (productMap.values.any { it.stripeProduct.id == productId && it.stripeProduct.enableTrial }
&& !hasCurrentOrPriorSubscription
) {
setSubscriptionData(
Expand Down

0 comments on commit 6b56e14

Please sign in to comment.