Skip to content

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

Add 100k plan

Acho Arnold29d02ebbb697
diff --git a/api/pkg/entities/user.go b/api/pkg/entities/user.go
index e592d270..99225330 100644
--- a/api/pkg/entities/user.go
+++ b/api/pkg/entities/user.go
@@ -28,6 +28,10 @@ func (subscription SubscriptionName) Limit() uint {
if subscription == SubscriptionName20KMonthly || subscription == SubscriptionName20KYearly {
return 20_000
}
+ if subscription == SubscriptionName100KMonthly || subscription == SubscriptionName100KYearly {
+ return 100_000
+ }
+
return 200
}
@@ -52,9 +56,15 @@ const SubscriptionNameProLifetime = SubscriptionName("pro-lifetime")
// SubscriptionName20KMonthly represents a monthly 20k subscription
const SubscriptionName20KMonthly = SubscriptionName("20k-monthly")
+// SubscriptionName100KMonthly represents a monthly 100k subscription
+const SubscriptionName100KMonthly = SubscriptionName("100k-monthly")
+
// SubscriptionName20KYearly represents a yearly 20k subscription
const SubscriptionName20KYearly = SubscriptionName("20k-yearly")
+// SubscriptionName100KYearly represents a yearly 100k subscription
+const SubscriptionName100KYearly = SubscriptionName("100k-yearly")
+
// User stores information about a user
type User struct {
ID UserID `json:"id" gorm:"primaryKey;type:string;" example:"WB7DRDWrJZRGbYrv2CKGkqbzvqdC"`
diff --git a/api/pkg/services/lemonsqueezy_service.go b/api/pkg/services/lemonsqueezy_service.go
index 2c97cc01..736dbdb6 100644
--- a/api/pkg/services/lemonsqueezy_service.go
+++ b/api/pkg/services/lemonsqueezy_service.go
@@ -158,5 +158,12 @@ func (service *LemonsqueezyService) subscriptionName(variant string) entities.Su
return entities.SubscriptionName20KYearly
}
+ if strings.Contains(strings.ToLower(variant), "100k") {
+ if strings.Contains(strings.ToLower(variant), "monthly") {
+ return entities.SubscriptionName100KMonthly
+ }
+ return entities.SubscriptionName100KYearly
+ }
+
return entities.SubscriptionNameFree
}
diff --git a/web/.env.production b/web/.env.production
index 1a7afe29..c6425bfb 100644
--- a/web/.env.production
+++ b/web/.env.production
@@ -8,3 +8,4 @@ APP_DOWNLOAD_URL=https://github.com/NdoleStudio/httpsms/releases/latest/download
APP_ENV=production
CHECKOUT_URL=https://httpsms.lemonsqueezy.com/checkout/buy/706c5638-4c8d-40db-a6f2-b6371b7e0af4
+ENTERPRISE_CHECKOUT_URL=https://httpsms.lemonsqueezy.com/checkout/buy/d107cf05-4b13-4ebd-a770-c2cc75c69a14
diff --git a/web/nuxt.config.js b/web/nuxt.config.js
index 74fc4d80..bd28a0ff 100644
--- a/web/nuxt.config.js
+++ b/web/nuxt.config.js
@@ -143,6 +143,7 @@ export default {
publicRuntimeConfig: {
checkoutURL: process.env.CHECKOUT_URL,
+ enterpriseCheckoutURL: process.env.ENTERPRISE_CHECKOUT_URL,
},
// Build Configuration: https://go.nuxtjs.dev/config-build
diff --git a/web/pages/billing/index.vue b/web/pages/billing/index.vue
index 05cf298d..5e914061 100644
--- a/web/pages/billing/index.vue
+++ b/web/pages/billing/index.vue
@@ -198,6 +198,33 @@
</v-card>
</v-hover>
</v-col>
+ <v-col cols="12" md="6" xl="4">
+ <v-hover v-slot="{ hover }">
+ <v-card
+ :color="hover ? 'black' : 'default'"
+ :href="enterpriseCheckoutURL"
+ outlined
+ >
+ <v-card-text>
+ <v-row align="center">
+ <v-col class="grow">
+ <h1
+ class="subtitle-1 font-weight-bold text-uppercase mt-3"
+ >
+ 100k - Monthly
+ </h1>
+ <p class="text--secondary">
+ 100,000 messages monthly
+ </p>
+ </v-col>
+ <v-col class="shrink">
+ <span class="text-h5 text--primary">$175</span>/month
+ </v-col>
+ </v-row>
+ </v-card-text>
+ </v-card>
+ </v-hover>
+ </v-col>
</v-row>
<h5 class="text-h4 mb-3 mt-4">Overview</h5>
<p class="text--secondary">
@@ -397,6 +424,18 @@ export default Vue.extend({
messagesPerMonth: 20000,
price: 350,
},
+ {
+ name: '100k - Monthly',
+ id: '100k-monthly',
+ messagesPerMonth: 100000,
+ price: 175,
+ },
+ {
+ name: '100k - Yearly',
+ id: '100k-yearly',
+ messagesPerMonth: 100000,
+ price: 1750,
+ },
{
name: 'PRO - Lifetime',
id: 'pro-lifetime',
@@ -420,6 +459,15 @@ export default Vue.extend({
url.searchParams.append('checkout[name]', user?.displayName)
return url.toString()
},
+ enterpriseCheckoutURL() {
+ const url = new URL(this.$config.enterpriseCheckoutURL)
+ const user = this.$store.getters.getAuthUser
+ url.searchParams.append('checkout[custom][user_id]', user?.id)
+ url.searchParams.append('checkout[email]', user?.email)
+ url.searchParams.append('checkout[name]', user?.displayName)
+ return url.toString()
+ },
+
plan(): PaymentPlan {
return this.plans.find(
(x) =>