File tree 4 files changed +17
-7
lines changed
.werft/jobs/build/payment
4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ metadata:
6
6
data :
7
7
config : |
8
8
{
9
- "usageProductPriceIds": {
9
+ "individualUsagePriceIds": {
10
+ "EUR": "price_1LiId7GadRXm50o3OayAS2y4",
11
+ "USD": "price_1LiIdbGadRXm50o3ylg5S44r"
12
+ },
13
+ "teamUsagePriceIds": {
10
14
"EUR": "price_1LiId7GadRXm50o3OayAS2y4",
11
15
"USD": "price_1LiIdbGadRXm50o3ylg5S44r"
12
16
}
Original file line number Diff line number Diff line change @@ -815,8 +815,8 @@ export interface RepositoryCloneInformation {
815
815
816
816
export interface CoreDumpConfig {
817
817
enabled ?: boolean ;
818
- softLimit ?: number ;
819
- hardLimit ?: number ;
818
+ softLimit ?: number ;
819
+ hardLimit ?: number ;
820
820
}
821
821
822
822
export interface WorkspaceConfig {
@@ -1520,6 +1520,11 @@ export interface Terms {
1520
1520
readonly formElements ?: object ;
1521
1521
}
1522
1522
1523
+ export interface StripeConfig {
1524
+ individualUsagePriceIds : { [ currency : string ] : string } ;
1525
+ teamUsagePriceIds : { [ currency : string ] : string } ;
1526
+ }
1527
+
1523
1528
export type BillingStrategy = "other" | "stripe" ;
1524
1529
export interface CostCenter {
1525
1530
readonly id : AttributionId ;
Original file line number Diff line number Diff line change @@ -139,7 +139,8 @@ export class StripeService {
139
139
throw new Error ( `Stripe customer '${ customerId } ' could not be found` ) ;
140
140
}
141
141
const currency = customer . metadata . preferredCurrency || "USD" ;
142
- const priceId = this . config ?. stripeConfig ?. usageProductPriceIds [ currency ] ;
142
+ // FIXME(janx): Use `individualUsagePriceIds` when subscribing users.
143
+ const priceId = this . config ?. stripeConfig ?. teamUsagePriceIds [ currency ] ;
143
144
if ( ! priceId ) {
144
145
throw new Error ( `No Stripe Price ID configured for currency '${ currency } '` ) ;
145
146
}
Original file line number Diff line number Diff line change 7
7
import { GitpodHostUrl } from "@gitpod/gitpod-protocol/lib/util/gitpod-host-url" ;
8
8
import { AuthProviderParams , normalizeAuthProviderParams } from "./auth/auth-provider" ;
9
9
10
- import { NamedWorkspaceFeatureFlag } from "@gitpod/gitpod-protocol" ;
10
+ import { NamedWorkspaceFeatureFlag , StripeConfig } from "@gitpod/gitpod-protocol" ;
11
11
12
12
import { RateLimiterConfig } from "./auth/rate-limiter" ;
13
13
import { CodeSyncConfig } from "./code-sync/code-sync-service" ;
@@ -27,7 +27,7 @@ export type Config = Omit<
27
27
workspaceDefaults : WorkspaceDefaults ;
28
28
chargebeeProviderOptions ?: ChargebeeProviderOptions ;
29
29
stripeSecrets ?: { publishableKey : string ; secretKey : string } ;
30
- stripeConfig ?: { usageProductPriceIds : { [ currency : string ] : string } } ;
30
+ stripeConfig ?: StripeConfig ;
31
31
builtinAuthProvidersConfigured : boolean ;
32
32
inactivityPeriodForRepos ?: number ;
33
33
} ;
@@ -266,7 +266,7 @@ export namespace ConfigFile {
266
266
log . error ( "Could not load Stripe secrets" , error ) ;
267
267
}
268
268
}
269
- let stripeConfig : { usageProductPriceIds : { EUR : string ; USD : string } } | undefined ;
269
+ let stripeConfig : StripeConfig | undefined ;
270
270
if ( config . enablePayment && config . stripeConfigFile ) {
271
271
try {
272
272
stripeConfig = JSON . parse ( fs . readFileSync ( filePathTelepresenceAware ( config . stripeConfigFile ) , "utf-8" ) ) ;
You can’t perform that action at this time.
0 commit comments