feat: Clean up payment links endpoints

This commit is contained in:
Ahmed Bouhuolia
2024-09-25 19:37:09 +02:00
parent 323b95de7b
commit 1cc71eb368
14 changed files with 183 additions and 132 deletions

View File

@@ -7,6 +7,7 @@ import {
} from '@/interfaces/StripePayment';
import HasTenancyService from '@/services/Tenancy/TenancyService';
import { Tenant } from '@/system/models';
import { initalizeTenantServices } from '@/api/middleware/TenantDependencyInjection';
@Service()
export class StripeWebhooksSubscriber {
@@ -41,6 +42,8 @@ export class StripeWebhooksSubscriber {
const tenantId = parseInt(metadata.tenantId, 10);
const saleInvoiceId = parseInt(metadata.saleInvoiceId, 10);
await initalizeTenantServices(tenantId);
// Get the amount from the event
const amount = event.data.object.amount_total;