@@ -101,15 +101,26 @@ export const stripeWebhook = new stripe.WebhookEndpoint("StripeWebhookEndpoint",
101101const zenProduct = new stripe . Product ( "ZenBlack" , {
102102 name : "OpenCode Black" ,
103103} )
104- const zenPrice = new stripe . Price ( "ZenBlackPrice" , {
104+ const zenPriceProps = {
105105 product : zenProduct . id ,
106- unitAmount : 20000 ,
107106 currency : "usd" ,
108107 recurring : {
109108 interval : "month" ,
110109 intervalCount : 1 ,
111110 } ,
111+ }
112+ const zenPrice200 = new stripe . Price ( "ZenBlackPrice" , { ...zenPriceProps , unitAmount : 20000 } )
113+ const zenPrice100 = new stripe . Price ( "ZenBlack100Price" , { ...zenPriceProps , unitAmount : 10000 } )
114+ const zenPrice20 = new stripe . Price ( "ZenBlack20Price" , { ...zenPriceProps , unitAmount : 2000 } )
115+ const ZEN_BLACK_PRICE = new sst . Linkable ( "ZEN_BLACK_PRICE" , {
116+ properties : {
117+ product : zenProduct . id ,
118+ plan200 : zenPrice200 . id ,
119+ plan100 : zenPrice100 . id ,
120+ plan20 : zenPrice20 . id ,
121+ } ,
112122} )
123+ const ZEN_BLACK_LIMITS = new sst . Secret ( "ZEN_BLACK_LIMITS" )
113124
114125const ZEN_MODELS = [
115126 new sst . Secret ( "ZEN_MODELS1" ) ,
@@ -121,7 +132,6 @@ const ZEN_MODELS = [
121132 new sst . Secret ( "ZEN_MODELS7" ) ,
122133 new sst . Secret ( "ZEN_MODELS8" ) ,
123134]
124- const ZEN_BLACK = new sst . Secret ( "ZEN_BLACK" )
125135const STRIPE_SECRET_KEY = new sst . Secret ( "STRIPE_SECRET_KEY" )
126136const STRIPE_PUBLISHABLE_KEY = new sst . Secret ( "STRIPE_PUBLISHABLE_KEY" )
127137const AUTH_API_URL = new sst . Linkable ( "AUTH_API_URL" , {
@@ -164,7 +174,8 @@ new sst.cloudflare.x.SolidStart("Console", {
164174 EMAILOCTOPUS_API_KEY ,
165175 AWS_SES_ACCESS_KEY_ID ,
166176 AWS_SES_SECRET_ACCESS_KEY ,
167- ZEN_BLACK ,
177+ ZEN_BLACK_PRICE ,
178+ ZEN_BLACK_LIMITS ,
168179 new sst . Secret ( "ZEN_SESSION_SECRET" ) ,
169180 ...ZEN_MODELS ,
170181 ...( $dev
0 commit comments