Skip to content

Commit c797330

Browse files
authored
Merge pull request #3 from nanoapi-io/feature/billing-changes
change in billing
2 parents 89e7a75 + 16467c8 commit c797330

File tree

14 files changed

+1743
-73
lines changed

14 files changed

+1743
-73
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
STRIPE_API_KEY=
22
WEBHOOK_SECRET=
3+
STRIPE_METER_CREDIT_USAGE_METER_ID=
34
STRIPE_PRODUCT_BASIC_LICENSE_MONTHLY_PRICE_ID=
45
STRIPE_PRODUCT_BASIC_LICENSE_YEARLY_PRICE_ID=
56
STRIPE_PRODUCT_BASIC_MONTHLY_METER_CREDIT_USAGE_PRICE_ID=

packages/app/deno.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@tailwindcss/vite": "npm:@tailwindcss/vite@^4.1.8",
2222
"@tanstack/react-table": "npm:@tanstack/react-table@^8.21.3",
2323
"@types/cytoscape-fcose": "npm:@types/cytoscape-fcose@^2.2.4",
24-
"@types/react": "npm:@types/react@^19.1.3",
24+
"@types/react": "npm:@types/react@^19.1.6",
2525
"@types/react-dom": "npm:@types/react-dom@^19.1.3",
2626
"@types/react-router": "npm:@types/react-router@^5.1.20",
2727
"@vitejs/plugin-react": "npm:@vitejs/plugin-react@^4.4.1",
@@ -50,6 +50,8 @@
5050
"start": "deno run -A npm:vite preview"
5151
},
5252
"compilerOptions": {
53-
"jsx": "react-jsx"
53+
"jsx": "react-jsx",
54+
"jsxImportSource": "react",
55+
"jsxImportSourceTypes": "@types/react"
5456
}
5557
}

packages/app/src/pages/workspaces/workspace/subscription.tsx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export default function WorkspaceSubscription() {
210210
<TableHead>Subscription status</TableHead>
211211
<TableHead>Payment method</TableHead>
212212
<TableHead>Current Subscription</TableHead>
213+
<TableHead>Current Credits Usage</TableHead>
213214
</TableRow>
214215
</TableHeader>
215216
<TableBody>
@@ -299,6 +300,11 @@ export default function WorkspaceSubscription() {
299300
)}
300301
</div>
301302
</TableCell>
303+
<TableCell>
304+
<Badge variant="secondary">
305+
{subscription.currentUsage} credits
306+
</Badge>
307+
</TableCell>
302308
</TableRow>
303309
</TableBody>
304310
</Table>
@@ -368,8 +374,8 @@ export default function WorkspaceSubscription() {
368374
title="Basic"
369375
description="Perfect for trying out the platform"
370376
features={[
371-
"50 credits included",
372-
"0.50 USD per additional credit",
377+
"5 credits included per month",
378+
"2.00 USD per additional credit",
373379
]}
374380
subscriptionPrice="Free"
375381
billingCycle={WorkspaceApiTypes
@@ -389,8 +395,8 @@ export default function WorkspaceSubscription() {
389395
title="Pro"
390396
description="Great for small teams and growing businesses"
391397
features={[
392-
"100 credits included",
393-
"0.25 USD per additional credit",
398+
"50 credits included per month",
399+
"1.00 USD per additional credit",
394400
]}
395401
subscriptionPrice="20 USD/month"
396402
billingCycle={WorkspaceApiTypes
@@ -410,9 +416,8 @@ export default function WorkspaceSubscription() {
410416
title="Premium"
411417
description="Perfect for medium teams with high volume needs"
412418
features={[
413-
"500 credits included",
414-
"0.10 USD per additional credit",
415-
"Support through discord and email (under 24h)",
419+
"250 credits included per month",
420+
"0.50 USD per additional credit",
416421
]}
417422
subscriptionPrice="50 USD/month"
418423
billingCycle={WorkspaceApiTypes
@@ -431,7 +436,9 @@ export default function WorkspaceSubscription() {
431436
product={WorkspaceApiTypes.CUSTOM_PRODUCT}
432437
title="Custom pricing"
433438
description="Everything tailored to your needs"
434-
features={[]}
439+
features={[
440+
"Anything you need",
441+
]}
435442
subscriptionPrice="Custom"
436443
billingCycle={WorkspaceApiTypes
437444
.MONTHLY_BILLING_CYCLE}
@@ -454,9 +461,9 @@ export default function WorkspaceSubscription() {
454461
title="Pro"
455462
description="Great for small teams and growing businesses"
456463
features={[
457-
"100 credits included",
458-
"0.25 USD per additional credit",
459-
"Save 20% compared to monthly subscription",
464+
"50 credits included per month",
465+
"1.00 USD per additional credit",
466+
"2 months free compared to monthly subscription",
460467
]}
461468
subscriptionPrice="200 USD/year"
462469
billingCycle={WorkspaceApiTypes
@@ -476,10 +483,9 @@ export default function WorkspaceSubscription() {
476483
title="Premium"
477484
description="Perfect for medium teams with high volume needs"
478485
features={[
479-
"500 credits included",
480-
"0.10 USD per additional credit",
481-
"Support through discord and email (under 24h)",
482-
"Save 20% compared to monthly subscription",
486+
"250 credits included per month",
487+
"0.50 USD per additional credit",
488+
"2 months free compared to monthly subscription",
483489
]}
484490
subscriptionPrice="500 USD/year"
485491
billingCycle={WorkspaceApiTypes
@@ -498,7 +504,9 @@ export default function WorkspaceSubscription() {
498504
product={WorkspaceApiTypes.CUSTOM_PRODUCT}
499505
title="Custom pricing"
500506
description="Everything tailored to your needs"
501-
features={[]}
507+
features={[
508+
"Anything you need",
509+
]}
502510
subscriptionPrice="Custom"
503511
billingCycle={WorkspaceApiTypes
504512
.YEARLY_BILLING_CYCLE}

packages/core/src/api/auth/service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export class AuthService {
193193
customer.id,
194194
BASIC_PRODUCT,
195195
MONTHLY_BILLING_CYCLE,
196+
settings.STRIPE.BILLING_THRESHOLD_BASIC,
196197
);
197198

198199
const accessEnabled = shouldHaveAccess(subscription.status);

0 commit comments

Comments
 (0)