fix: Listen to Stripe session completed event

This commit is contained in:
Ahmed Bouhuolia
2024-09-30 11:49:19 +02:00
parent 15ce6ac710
commit ad8fe52b84
2 changed files with 15 additions and 12 deletions

View File

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