feat(billing): add billing endpoints#121
Conversation
0d1d5b3 to
2fe29d0
Compare
| process.env.FEATURE_DB_HOST = 'localhost'; | ||
| process.env.FEATURE_DB_PORT = '5432'; | ||
| process.env.FEATURE_DB_USER = 'test'; | ||
| process.env.FEATURE_DB_PASSWORD = 'test'; | ||
| process.env.FEATURE_DB_DATABASE = 'test'; | ||
| process.env.FEATURE_DB_SCHEMA = 'public'; | ||
| // Billing config | ||
| process.env.SITE = 'test'; | ||
| process.env.API_KEY = 'test'; | ||
| process.env.STRIPE_SECRET = 'test'; |
There was a problem hiding this comment.
why a database setup, cant we use memory store here ?
| @post(`${BASE}/customers`, { | ||
| summary: 'Create a new customer', | ||
| responses: { | ||
| '200': { |
| schema: { | ||
| type: 'object', | ||
| required: ['firstName', 'lastName', 'email'], | ||
| properties: { | ||
| firstName: {type: 'string', example: 'John'}, | ||
| lastName: {type: 'string', example: 'Doe'}, | ||
| email: {type: 'string', example: 'john.doe@example.com'}, | ||
| company: {type: 'string', example: 'Acme Inc.'}, | ||
| phone: {type: 'string', example: '+1234567890'}, | ||
| billingAddress: { | ||
| type: 'object', | ||
| properties: { | ||
| line1: {type: 'string'}, | ||
| city: {type: 'string'}, | ||
| state: {type: 'string'}, | ||
| zip: {type: 'string'}, | ||
| country: {type: 'string', example: 'US'}, |
| 'application/json': { | ||
| schema: { | ||
| type: 'object', | ||
| properties: { | ||
| firstName: {type: 'string'}, | ||
| lastName: {type: 'string'}, | ||
| email: {type: 'string'}, | ||
| company: {type: 'string'}, | ||
| phone: {type: 'string'}, | ||
| billingAddress: { | ||
| type: 'object', | ||
| properties: { | ||
| line1: {type: 'string'}, | ||
| city: {type: 'string'}, | ||
| state: {type: 'string'}, | ||
| zip: {type: 'string'}, | ||
| country: {type: 'string'}, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, |
| this.application.bind(StripeBindings.config).to({ | ||
| secretKey: process.env.STRIPE_SECRET ?? '', | ||
| }); | ||
| this.application | ||
| .bind(BillingComponentBindings.SDKProvider) | ||
| .toProvider(StripeServiceProvider); | ||
|
|
There was a problem hiding this comment.
this will be in sandbox
| // Mount authorization component for default sequence | ||
| this.application.bind(AuthorizationBindings.CONFIG).to({ | ||
| allowAlwaysPaths: ['/explorer'], | ||
| allowAlwaysPaths: ['/explorer', '/billing', '/webhooks'], |
There was a problem hiding this comment.
there was a webhook component right ?
| SITE= | ||
| API_KEY= | ||
| STRIPE_SECRET= | ||
| CHARGEBEE_ITEM_FAMILY_ID= | ||
| BILLING_PROVIDER= |
There was a problem hiding this comment.
no all this will b ein sandbox
| }, | ||
| }) | ||
| async createCustomer( | ||
| @requestBody({ |
There was a problem hiding this comment.
does this create the customer on stripe? if yes, then we alreayd has the apis to create the customer. what is the difference between them
| }, | ||
| }) | ||
| async getCustomer( | ||
| @param.path.string('customerId') customerId: string, |
There was a problem hiding this comment.
these endpoints already exist exist , review pls
| }, | ||
| }) | ||
| paymentDto: BillingPaymentSourceBody, | ||
| ): Promise<TPaymentSource> { |
There was a problem hiding this comment.
we already have the api , then why need to create new
| }, | ||
| }, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
keep them seprate , for product , price, keep them separate
| * interceptor to BILLING_WEBHOOK_VERIFIER in application.ts. | ||
| */ | ||
| export class BillingWebhookController { | ||
| constructor( |
There was a problem hiding this comment.
we already had a controller for ir
SonarQube reviewer guide
|



Description
This PR adds three new billing endpoints to retrieve detailed payment and invoice information, along with TypeScript type improvements for webhook handling. The new endpoints provide essential functionality for invoice management and payment tracking in SaaS subscription workflows.
Type of change
Checklist: