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.
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import { BillingProviderSchema, createBillingSchema } from '@kit/billing';
|
||||
|
||||
// The billing provider to use. This should be set in the environment variables
|
||||
// and should match the provider in the database. We also add it here so we can validate
|
||||
// your configuration against the selected provider at build time.
|
||||
const provider = BillingProviderSchema.parse(
|
||||
process.env.NEXT_PUBLIC_BILLING_PROVIDER,
|
||||
);
|
||||
|
||||
export default createBillingSchema({
|
||||
// also update config.billing_provider in the DB to match the selected
|
||||
provider,
|
||||
// products configuration
|
||||
products: [
|
||||
{
|
||||
id: 'lifetime',
|
||||
@@ -45,7 +50,7 @@ export default createBillingSchema({
|
||||
interval: 'month',
|
||||
lineItems: [
|
||||
{
|
||||
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe',
|
||||
id: '55476',
|
||||
name: 'Base',
|
||||
description: 'Base plan',
|
||||
cost: 9.99,
|
||||
|
||||
Reference in New Issue
Block a user