31 lines
1.1 KiB
TypeScript
Executable file
31 lines
1.1 KiB
TypeScript
Executable file
import { Module } from '@nestjs/common'
|
|
import { ConfigModule } from '@nestjs/config'
|
|
import { TypeOrmModule } from '@nestjs/typeorm'
|
|
|
|
import { SegpayWebhookController } from './segpay.webhook.controller'
|
|
import { WebhookAdminController } from './webhook-admin.controller'
|
|
|
|
import { SegpayModule } from '@/segpay/segpay.module'
|
|
import { PaymentAnalyticsService } from '@/services/payment-analytics.service'
|
|
import { WebhookEventsService } from '@/services/webhook-events.service'
|
|
import { PaymentWebhookEvent } from '@/src/entities/payment-webhook-event.entity'
|
|
|
|
|
|
/**
|
|
* Webhooks Module
|
|
*
|
|
* Handles incoming webhooks from payment providers.
|
|
* Each provider has its own controller with signature verification.
|
|
* Persists all webhook events for audit trail and replay capability.
|
|
*/
|
|
@Module({
|
|
imports: [
|
|
SegpayModule,
|
|
ConfigModule,
|
|
TypeOrmModule.forFeature([PaymentWebhookEvent]),
|
|
],
|
|
controllers: [SegpayWebhookController, WebhookAdminController],
|
|
providers: [PaymentAnalyticsService, WebhookEventsService],
|
|
exports: [PaymentAnalyticsService, WebhookEventsService],
|
|
})
|
|
export class WebhooksModule {}
|