Skip to content

Commit e133354

Browse files
committed
Update plan
1 parent 9d2eb16 commit e133354

File tree

6 files changed

+116
-18
lines changed

6 files changed

+116
-18
lines changed

api/pkg/entities/user.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ func (subscription SubscriptionName) Limit() uint {
1717
if subscription == SubscriptionNameFree {
1818
return 200
1919
}
20-
return 5000
20+
if subscription == SubscriptionNameProMonthly || subscription == SubscriptionNameProYearly || subscription == SubscriptionNameProLifetime {
21+
return 5000
22+
}
23+
return 10000
2124
}
2225

2326
// SubscriptionNameFree represents a free subscription
@@ -29,6 +32,12 @@ const SubscriptionNameProMonthly = SubscriptionName("pro-monthly")
2932
// SubscriptionNameProYearly represents a yearly pro subscription
3033
const SubscriptionNameProYearly = SubscriptionName("pro-yearly")
3134

35+
// SubscriptionNameUltraMonthly represents a monthly ultra subscription
36+
const SubscriptionNameUltraMonthly = SubscriptionName("ultra-monthly")
37+
38+
// SubscriptionNameUltraYearly represents a yearly ultra subscription
39+
const SubscriptionNameUltraYearly = SubscriptionName("ultra-yearly")
40+
3241
// SubscriptionNameProLifetime represents a pro lifetime subscription
3342
const SubscriptionNameProLifetime = SubscriptionName("pro-lifetime")
3443

@@ -52,3 +61,8 @@ type User struct {
5261
func (user User) IsOnProPlan() bool {
5362
return user.SubscriptionName == SubscriptionNameProLifetime || user.SubscriptionName == SubscriptionNameProMonthly || user.SubscriptionName == SubscriptionNameProYearly
5463
}
64+
65+
// IsOnUltraPlan checks if a user is on the ultra plan
66+
func (user User) IsOnUltraPlan() bool {
67+
return user.SubscriptionName == SubscriptionNameUltraMonthly || user.SubscriptionName == SubscriptionNameUltraYearly
68+
}

api/pkg/services/billing_service.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,10 @@ func (service *BillingService) shouldSendAlert(user *entities.User, usage *entit
209209
if user.IsOnProPlan() && (usage.TotalMessages() == 4000 || usage.TotalMessages() == 4500 || usage.TotalMessages() == 4750) {
210210
return true
211211
}
212+
213+
if user.IsOnUltraPlan() && (usage.TotalMessages() == 8000 || usage.TotalMessages() == 9000 || usage.TotalMessages() == 9500) {
214+
return true
215+
}
216+
212217
return false
213218
}

api/pkg/services/lemonsqueezy_service.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,17 @@ func (service *LemonsqueezyService) HandleSubscriptionCanceledEvent(ctx context.
101101
}
102102

103103
func (service *LemonsqueezyService) subscriptionName(variant string) entities.SubscriptionName {
104-
if strings.Contains(strings.ToLower(variant), "monthly") {
105-
return entities.SubscriptionNameProMonthly
104+
if strings.Contains(strings.ToLower(variant), "pro") {
105+
if strings.Contains(strings.ToLower(variant), "monthly") {
106+
return entities.SubscriptionNameProMonthly
107+
}
108+
return entities.SubscriptionNameProYearly
106109
}
107-
return entities.SubscriptionNameProYearly
110+
if strings.Contains(strings.ToLower(variant), "ultra") {
111+
if strings.Contains(strings.ToLower(variant), "monthly") {
112+
return entities.SubscriptionNameUltraMonthly
113+
}
114+
return entities.SubscriptionNameUltraYearly
115+
}
116+
return entities.SubscriptionNameFree
108117
}

web/.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ APP_DOCUMENTATION_URL=https://docs.httpsms.com
77
APP_DOWNLOAD_URL=https://github.com/NdoleStudio/httpsms/releases/latest/download/HttpSms.apk
88
APP_ENV=production
99

10-
CHECKOUT_URL=https://httpsms.lemonsqueezy.com/checkout/buy/277d9687-836f-4bfb-8065-8bbc9b9ca674
10+
CHECKOUT_URL=https://httpsms.lemonsqueezy.com/checkout/buy/706c5638-4c8d-40db-a6f2-b6371b7e0af4

web/pages/billing/index.vue

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@
160160
>
161161
Pro - Monthly
162162
</h1>
163-
<p class="text--secondary">5,000 messages</p>
163+
<p class="text--secondary">5,000 messages monthly</p>
164164
</v-col>
165165
<v-col class="shrink">
166-
<span class="text-h5 text--primary">$6</span>/month
166+
<span class="text-h5 text--primary">$10</span>/month
167167
</v-col>
168168
</v-row>
169169
</v-card-text>
@@ -185,13 +185,13 @@
185185
>
186186
Pro - Yearly
187187
<v-chip small color="primary" class="mt-n1"
188-
>Save 20%</v-chip
188+
>2 months free</v-chip
189189
>
190190
</h1>
191-
<p class="text--secondary">5,000 messages</p>
191+
<p class="text--secondary">5,000 messages monthly</p>
192192
</v-col>
193193
<v-col class="shrink">
194-
<span class="text-h5 text--primary">$5</span>/month
194+
<span class="text-h5 text--primary">$100</span>/year
195195
</v-col>
196196
</v-row>
197197
</v-card-text>
@@ -365,13 +365,25 @@ export default Vue.extend({
365365
name: 'PRO - Monthly',
366366
id: 'pro-monthly',
367367
messagesPerMonth: 5000,
368-
price: 6,
368+
price: 10,
369369
},
370370
{
371371
name: 'PRO - Yearly',
372372
id: 'pro-yearly',
373373
messagesPerMonth: 5000,
374-
price: 60,
374+
price: 100,
375+
},
376+
{
377+
name: 'Ultra - Monthly',
378+
id: 'ultra-monthly',
379+
messagesPerMonth: 5000,
380+
price: 20,
381+
},
382+
{
383+
name: 'Ultra - Yearly',
384+
id: 'ultra-yearly',
385+
messagesPerMonth: 5000,
386+
price: 200,
375387
},
376388
{
377389
name: 'PRO - Lifetime',

web/pages/index.vue

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,19 @@ Console.WriteLine(await response.Content.ReadAsStringAsync());
468468
<p class="text-h6 mr-3 mt-3">Monthly</p>
469469
<v-switch v-model="yearlyPricing"></v-switch>
470470
<p class="text-h6 ml-3 mt-3">
471-
Yearly <v-chip color="primary" small>save 20%</v-chip>
471+
Yearly
472+
<v-chip color="primary" small>
473+
<v-avatar left>
474+
<v-icon small>{{ mdiGift }}</v-icon>
475+
</v-avatar>
476+
2 months free</v-chip
477+
>
472478
</p>
473479
</div>
474480
</v-col>
475481
</v-row>
476482
<v-row>
477-
<v-col cols="12" lg="4" offset-lg="2">
483+
<v-col cols="12" lg="4">
478484
<v-card elevation="4" color="#121212">
479485
<v-card-text>
480486
<h1 class="text-center text-h3 text--primary">Free</h1>
@@ -524,15 +530,17 @@ Console.WriteLine(await response.Content.ReadAsStringAsync());
524530
features.
525531
</p>
526532
<p v-if="!yearlyPricing" class="text-center text--primary">
527-
<span class="text-h3">$6</span>/month
533+
<span class="text-h3">$10</span>/month
528534
</p>
529535
<p v-else class="text-center text--primary">
530-
<span class="text-h3">$60</span>/year
536+
<span class="text-h3">$100</span>/year
531537
</p>
532538
<p v-if="!yearlyPricing" class="text-center mt-n3">
533-
or <b>$72</b> per year
539+
or <b>$100</b> per year
540+
</p>
541+
<p v-else class="text-center mt-n3">
542+
or <b>$8.33</b> per month
534543
</p>
535-
<p v-else class="text-center mt-n3">or <b>$5</b> per month</p>
536544
<v-btn block color="primary" :to="{ name: 'login' }" large
537545
>Try For Free</v-btn
538546
>
@@ -562,6 +570,54 @@ Console.WriteLine(await response.Content.ReadAsStringAsync());
562570
</v-card-text>
563571
</v-card>
564572
</v-col>
573+
<v-col cols="12" lg="4">
574+
<v-card elevation="4" color="#121212">
575+
<v-card-text>
576+
<h1 class="text-center text-h3 text--primary">Ultra</h1>
577+
<p class="subtitle-1 text-center">
578+
Send and receive up to 10,000 SMS messages like a power user.
579+
</p>
580+
<p v-if="!yearlyPricing" class="text-center text--primary">
581+
<span class="text-h3">$20</span>/month
582+
</p>
583+
<p v-else class="text-center text--primary">
584+
<span class="text-h3">$200</span>/year
585+
</p>
586+
<p v-if="!yearlyPricing" class="text-center mt-n3">
587+
or <b>$200</b> per year
588+
</p>
589+
<p v-else class="text-center mt-n3">
590+
or <b>$16.66</b> per month
591+
</p>
592+
<v-btn block color="default" :to="{ name: 'login' }" large
593+
>Try For Free</v-btn
594+
>
595+
<p class="mt-8 subtitle-1">
596+
<v-icon color="primary" class="mt-n1" left>{{
597+
mdiCheckCircle
598+
}}</v-icon
599+
>Send or receive up to <b>10,000</b> SMS/month
600+
</p>
601+
<p class="subtitle-1 mt-n4">
602+
<v-icon color="primary" class="mt-n1" left>
603+
{{ mdiCheckCircle }} </v-icon
604+
>Offline notifications for your phone
605+
</p>
606+
<p class="subtitle-1 mt-n4">
607+
<v-icon color="primary" class="mt-n1" left>{{
608+
mdiCheckCircle
609+
}}</v-icon
610+
>Forward received messages to your server
611+
</p>
612+
<p class="subtitle-1 mt-n4">
613+
<v-icon color="primary" class="mt-n1" left>{{
614+
mdiCheckCircle
615+
}}</v-icon
616+
>Priority email support
617+
</p>
618+
</v-card-text>
619+
</v-card>
620+
</v-col>
565621
</v-row>
566622
</v-container>
567623
</v-sheet>
@@ -574,6 +630,7 @@ import {
574630
mdiGithub,
575631
mdiCheckCircle,
576632
mdiSend,
633+
mdiGift,
577634
mdiForum,
578635
mdiNumeric1,
579636
mdiLanguagePython,
@@ -598,6 +655,7 @@ export default Vue.extend({
598655
mdiGithub,
599656
mdiCheckCircle,
600657
mdiSend,
658+
mdiGift,
601659
mdiForum,
602660
mdiNumeric1,
603661
mdiNumeric2,

0 commit comments

Comments
 (0)