Commit Graph

24 Commits

Author SHA1 Message Date
Giancarlo Buomprisco
6268d1bab0 Updated dependencies, Added Hosted mode for Stripe checkout
* chore: bump version to 3.1.0 and update dependencies in package.json, pnpm-lock.yaml, and pnpm-workspace.yaml; enhance billing services with support for hosted checkout page in Stripe integration

* Enhance error handling in billing services to log error messages instead of objects; update documentation for Stripe integration to clarify publishable key requirements based on UI mode.
2026-03-31 12:44:30 +08:00
Giancarlo Buomprisco
7ebff31475 Next.js Supabase V3 (#463)
Version 3 of the kit:
- Radix UI replaced with Base UI (using the Shadcn UI patterns)
- next-intl replaces react-i18next
- enhanceAction deprecated; usage moved to next-safe-action
- main layout now wrapped with [locale] path segment
- Teams only mode
- Layout updates
- Zod v4
- Next.js 16.2
- Typescript 6
- All other dependencies updated
- Removed deprecated Edge CSRF
- Dynamic Github Action runner
2026-03-24 13:40:38 +08:00
gbuomprisco
4912e402a3 Revert "Unify workspace dropdowns; Update layouts (#458)"
This reverts commit 4bc8448a1d.
2026-03-11 14:47:47 +08:00
Giancarlo Buomprisco
4bc8448a1d Unify workspace dropdowns; Update layouts (#458)
Unified Account and Workspace drop-downs; Layout updates, now header lives within the PageBody component; Sidebars now use floating variant
2026-03-11 14:45:42 +08:00
Giancarlo Buomprisco
ca585e09be 2.24.1 (#453)
* 2.24.1

- Updated dependencies
- MCP Server: better compatibility with Windows
- MCP Server: allow using a custom root for better flexibility
- Version Check: use package.json version instead of number of commits
- Prettier: reformatted some files
- Add SSH_AUTH_SOCK to dev passThroughEnv to solve SSH issues; handle execSync errors
- Use GIT_SSH to fix SSH issues on Windows
- Updated Stripe version
- Updated application version from 2.24.0 to 2.24.1 in package.json.
- Enhanced error handling in billing services to include error causes for better debugging.
2026-02-26 18:22:35 +08:00
Giancarlo Buomprisco
c77c380c9c chore: bump version to 2.21.9 and update dependencies across multiple packages (#420)
- Updated application version from 2.21.8 to 2.21.9 in package.json.
- Upgraded dependencies including prettier to version 3.7.4, @supabase/supabase-js to version 2.86.0, and @tanstack/react-query to version 5.90.11.
- Adjusted various package.json files to reflect updated versions for lucide-react, react-hook-form, and nodemailer.
- Enhanced pnpm-lock.yaml and pnpm-workspace.yaml for consistency in package versions.
- Refactored import statements in several components for improved readability.
2025-12-03 14:04:54 +08:00
Giancarlo Buomprisco
856e9612c4 Improve billing plan lookup (#270)
Retrieve plan from Stripe/LS if not found in billing configuration. Useful for legacy plans.
2025-06-13 17:45:55 +08:00
Giancarlo Buomprisco
903ef6dc08 Update Stripe SDK to v18 and dependencies (#236)
* Update Stripe SDK and dependencies

1. Upgrade `stripe` package from version 17.7.0 to 18.0.0 in `package.json`.
2. Update `STRIPE_API_VERSION` in `stripe-sdk.ts` to '2025-03-31.basil'.
3. Refactor `StripeWebhookHandlerService` to retrieve subscription details using Supabase client, ensuring compatibility with the new Stripe version.
4. Introduce helper methods `getPeriodStartsAt` and `getPeriodEndsAt` for better handling of subscription periods based on the Stripe API changes.

These changes enhance the integration with the latest Stripe API and improve the overall reliability of the billing service.

* Refactor billing payload builders to remove config dependency

Removed direct dependency on `BillingConfig` in subscription payload builders.

Introduced `PlanTypeMap` to streamline plan type resolutions. Updated webhook handlers and event processing functions to handle plan types more efficiently and improve extensibility.

* Refactor Stripe subscription handling for improved accuracy
2025-04-22 10:42:12 +08:00
Giancarlo Buomprisco
9bdab95909 Do not use "line_items" expand when getting the subscription object (#101) 2025-01-03 11:47:39 +08:00
gbuomprisco
23154c366d Remove Cloudflare mailer implementation, update dependencies and updated code to reflect stricter EsLint settings
Deleted CloudflareMailer class and its implementation from the mailers package. Updated dependencies across various packages, converting certain imports to use `type` only, and bumped versions for packages like `react-query`, `lucide-react`, and others.
2024-08-01 14:57:55 +02:00
Giancarlo Buomprisco
6a339a4b02 Billing get subscription enhancement (#36)
* Filter out metered line items from billing schema

This update refines the process of creating a billing schema by filtering out metered line items. The change is necessary as metered line items can be shared across different plans, potentially causing conflicts or duplicates in the schema.

* Update packages to newer versions

This update upgrades several packages across multiple project files to their latest version. These packages include "supabase-js", "react-query", "react-hook-form", and "pnpm". The commit ensures the project is up-to-date with recent package versions, potentially benefiting from bug fixes, new features, and performance improvements.

* Add subscription retrieval in billing services

Added a function to retrieve subscription info in both Stripe and LemonSqueezy billing services. To accomplish this, new methods were added to related services and types. This allows querying specific subscription data based on its id, and throws an error if it fails. Furthermore, PayloadBuilder classes were created to systematically build the subscription payload.

* Remove account ID retrieval from Lemon Squeezy billing service

The code that was querying the database to fetch the accountId has been removed from lemon-squeezy-billing-strategy.service.ts. It was unnecessary as the Lemon Squeezy API does not provide account ID and therefore it is always left empty. Also, adjustments have been made in billing-strategy-provider.service.ts to reflect that the target account ID can be optional.

* Extract 'next' parameter from callback URL

The update allows for the extraction of the 'next' parameter from the callback URL. If such a parameter is available, it is subsequently added to the search parameters. The enhancement improves URL parameter handling in the authentication callback service.

* Refactor URL redirection in auth-callback service

The update simplifies the redirection logic in the authentication callback service. This is achieved by setting the url pathname directly to the redirect path, instead of first setting it to the callback parameter. Moreover, the code handling the 'next' path has also been streamlined, setting the url pathname to the next path when available.
2024-06-19 23:00:00 +08:00
giancarlo
09c24346a6 Update logging and return statements in billing services
The commit modifies the logging level in the billing services from 'error' to 'info'. Moreover, the error statement has been modified to clarify that the subscription cancellation has possibly been done by the user. Also, it reduces redundant imports and beefs up the return structure in stripe-billing-strategy.service.
2024-05-15 11:28:37 +07:00
Giancarlo Buomprisco
4e50094808 Fix upsert billing (#24)
This commit updates the product_id and variant_id in both the subscription_items and order_items in the billing tests. Updates also include adding new checks to verify these changes. Changes are reflected in corresponding SQL files for personal and team billing subscriptions/orders tests.
2024-05-15 11:08:19 +07:00
giancarlo
3efbf6029f Optimize code for accounts and roles management
The large update includes optimization for account and role management. The code has been revised for better readability and efficiency. Changes include formatting updates and enhancements to the creation and handling of accounts, roles, and memberships. Privacy settings have also been adjusted to provide more secure handling of user data. Code comments have been updated for better understanding of the functions.
2024-04-28 12:55:01 +07:00
giancarlo
07deb28e12 1. Updated packages
2. Added comments to schema
3. Minor API updates
2024-04-27 14:39:28 +07:00
giancarlo
8d04624b1d Add queryUsage method to billing services
A new method, queryUsage, has been added to the billing strategy classes and the gateway service to offer usage querying capabilities for Stripe and Lemon Squeezy. QueryBillingUsageSchema has also been introduced in the schema-related changes. Changes also include updates to the functions' comment descriptions. A minor tweak was made to the Button and Link components in the `faq/page.tsx' file.
2024-04-25 11:34:47 +07:00
giancarlo
5b837d2fa8 Update UI style and enhance billing services
Several changes have been made in this commit. Firstly, updates have been made to the site-header-account-section and the pricing-table components to enhance UI aesthetics. Secondly, billing services have been significantly improved. A new method for retrieving plan information by an ID has been introduced. This method is available for all strategy services, including Stripe and Lemon-Squeezy. Furthermore, the way context and logging are handled during the billing process has been streamlined for better readability and efficiency.
2024-04-11 10:29:52 +08:00
giancarlo
37c5e3ed76 Refactor logger usage and add discount field to checkout
This commit refactors the logger usage in various files to make it more streamlined and consistent. It also introduces a new 'enableDiscountField' feature for the checkout that can be toggled on specific products. This allows customers to apply discounts at checkout if the product or subscription plan has the 'enableDiscountField' set to true.
2024-04-10 22:04:38 +08:00
giancarlo
a9eaaafd3d Update packages and refactor logging in diverse services
This commit updates diverse packages such as "@makerkit/data-loader-supabase-core" and "@makerkit/data-loader-supabase-nextjs" to the new versions in the package.json files. Also, several refactorings were done in logging within services and loaders by progressing 'server-only' imports and improving context handling. Additionally, type annotations have been added to several exported functions for better code readability and maintainability.
2024-04-09 17:23:48 +08:00
giancarlo
9fca45c2de Replace Logger with getLogger and update next version
This commit replaces the use of Logger with getLogger in various parts of the code to handle logging. The Logger has been replaced with getLogger, which assists in getting logs in an asynchronous manner. In addition to this, it updates the next version in pnpm-lock.yaml from next@14.2.0-canary.61 to next@14.2.0-canary.62 and various other dependencies. Also made minor annotations and comments to the function 'isBrowser' and 'formatCurrency' in the 'utils.ts' file.
2024-04-08 12:23:15 +08:00
giancarlo
220a23e185 Implement updateSubscription feature and refactor billing services
This commit introduces the updateSubscription method to the BillingStrategyProviderService, ensuring that subscriptions can be updated within the billing core. Additionally, a refactor has been applied to the BillingGatewayFactoryService and stripe-billing-strategy.service to improve error handling and the robustness of subscription updates. Logging in the webhook route has been adjusted for clarity and the data model has been enhanced.
2024-04-04 20:15:12 +08:00
giancarlo
4a122ee5df Refactor usage reporting for metered subscriptions 2024-04-04 16:42:10 +08:00
giancarlo
d24cf8427f Refactor billing system and enhance logging
Updated the billing system's schema to change 'storeId' to a string type, and improved the cleanliness and readability of the code. Enhanced the logging system within the billing service for better tracking and debugging. In line with these changes, added corresponding error pages in the client side to handle any errors.
2024-04-02 12:19:09 +08:00
giancarlo
8784a40a69 Add Lemon Squeezy Billing System 2024-04-01 21:43:18 +08:00