Skip to content

Commit 29d02eb

Browse files
committed
Add 100k plan
1 parent a355fb1 commit 29d02eb

File tree

5 files changed

+67
-0
lines changed

5 files changed

+67
-0
lines changed

api/pkg/entities/user.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ func (subscription SubscriptionName) Limit() uint {
2828
if subscription == SubscriptionName20KMonthly || subscription == SubscriptionName20KYearly {
2929
return 20_000
3030
}
31+
if subscription == SubscriptionName100KMonthly || subscription == SubscriptionName100KYearly {
32+
return 100_000
33+
}
34+
3135
return 200
3236
}
3337

@@ -52,9 +56,15 @@ const SubscriptionNameProLifetime = SubscriptionName("pro-lifetime")
5256
// SubscriptionName20KMonthly represents a monthly 20k subscription
5357
const SubscriptionName20KMonthly = SubscriptionName("20k-monthly")
5458

59+
// SubscriptionName100KMonthly represents a monthly 100k subscription
60+
const SubscriptionName100KMonthly = SubscriptionName("100k-monthly")
61+
5562
// SubscriptionName20KYearly represents a yearly 20k subscription
5663
const SubscriptionName20KYearly = SubscriptionName("20k-yearly")
5764

65+
// SubscriptionName100KYearly represents a yearly 100k subscription
66+
const SubscriptionName100KYearly = SubscriptionName("100k-yearly")
67+
5868
// User stores information about a user
5969
type User struct {
6070
ID UserID `json:"id" gorm:"primaryKey;type:string;" example:"WB7DRDWrJZRGbYrv2CKGkqbzvqdC"`

api/pkg/services/lemonsqueezy_service.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,12 @@ func (service *LemonsqueezyService) subscriptionName(variant string) entities.Su
158158
return entities.SubscriptionName20KYearly
159159
}
160160

161+
if strings.Contains(strings.ToLower(variant), "100k") {
162+
if strings.Contains(strings.ToLower(variant), "monthly") {
163+
return entities.SubscriptionName100KMonthly
164+
}
165+
return entities.SubscriptionName100KYearly
166+
}
167+
161168
return entities.SubscriptionNameFree
162169
}

web/.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ APP_DOWNLOAD_URL=https://github.com/NdoleStudio/httpsms/releases/latest/download
88
APP_ENV=production
99

1010
CHECKOUT_URL=https://httpsms.lemonsqueezy.com/checkout/buy/706c5638-4c8d-40db-a6f2-b6371b7e0af4
11+
ENTERPRISE_CHECKOUT_URL=https://httpsms.lemonsqueezy.com/checkout/buy/d107cf05-4b13-4ebd-a770-c2cc75c69a14

web/nuxt.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export default {
143143

144144
publicRuntimeConfig: {
145145
checkoutURL: process.env.CHECKOUT_URL,
146+
enterpriseCheckoutURL: process.env.ENTERPRISE_CHECKOUT_URL,
146147
},
147148

148149
// Build Configuration: https://go.nuxtjs.dev/config-build

web/pages/billing/index.vue

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,33 @@
198198
</v-card>
199199
</v-hover>
200200
</v-col>
201+
<v-col cols="12" md="6" xl="4">
202+
<v-hover v-slot="{ hover }">
203+
<v-card
204+
:color="hover ? 'black' : 'default'"
205+
:href="enterpriseCheckoutURL"
206+
outlined
207+
>
208+
<v-card-text>
209+
<v-row align="center">
210+
<v-col class="grow">
211+
<h1
212+
class="subtitle-1 font-weight-bold text-uppercase mt-3"
213+
>
214+
100k - Monthly
215+
</h1>
216+
<p class="text--secondary">
217+
100,000 messages monthly
218+
</p>
219+
</v-col>
220+
<v-col class="shrink">
221+
<span class="text-h5 text--primary">$175</span>/month
222+
</v-col>
223+
</v-row>
224+
</v-card-text>
225+
</v-card>
226+
</v-hover>
227+
</v-col>
201228
</v-row>
202229
<h5 class="text-h4 mb-3 mt-4">Overview</h5>
203230
<p class="text--secondary">
@@ -397,6 +424,18 @@ export default Vue.extend({
397424
messagesPerMonth: 20000,
398425
price: 350,
399426
},
427+
{
428+
name: '100k - Monthly',
429+
id: '100k-monthly',
430+
messagesPerMonth: 100000,
431+
price: 175,
432+
},
433+
{
434+
name: '100k - Yearly',
435+
id: '100k-yearly',
436+
messagesPerMonth: 100000,
437+
price: 1750,
438+
},
400439
{
401440
name: 'PRO - Lifetime',
402441
id: 'pro-lifetime',
@@ -420,6 +459,15 @@ export default Vue.extend({
420459
url.searchParams.append('checkout[name]', user?.displayName)
421460
return url.toString()
422461
},
462+
enterpriseCheckoutURL() {
463+
const url = new URL(this.$config.enterpriseCheckoutURL)
464+
const user = this.$store.getters.getAuthUser
465+
url.searchParams.append('checkout[custom][user_id]', user?.id)
466+
url.searchParams.append('checkout[email]', user?.email)
467+
url.searchParams.append('checkout[name]', user?.displayName)
468+
return url.toString()
469+
},
470+
423471
plan(): PaymentPlan {
424472
return this.plans.find(
425473
(x) =>

0 commit comments

Comments
 (0)