37 lines
1.5 KiB
TypeScript
Executable file
37 lines
1.5 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 { NOWPaymentsWebhookController } from './nowpayments.webhook.controller'
|
|
import { WebhookAdminController } from './webhook-admin.controller'
|
|
|
|
import { SegpayModule } from '@/segpay/segpay.module'
|
|
import { NOWPaymentsModule } from '@/nowpayments/nowpayments.module'
|
|
import { PaymentAnalyticsService } from '@/services/payment-analytics.service'
|
|
import { WebhookEventsService } from '@/services/webhook-events.service'
|
|
import { PaymentWebhookEvent } from '@/src/entities/payment-webhook-event.entity'
|
|
import { TransactionEntity } from '@/src/entities/transaction.entity'
|
|
import { EarningsModule } from '@/earnings/earnings.module'
|
|
|
|
|
|
/**
|
|
* 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,
|
|
NOWPaymentsModule,
|
|
ConfigModule,
|
|
TypeOrmModule.forFeature([PaymentWebhookEvent, TransactionEntity]),
|
|
EarningsModule,
|
|
],
|
|
controllers: [SegpayWebhookController, NOWPaymentsWebhookController, WebhookAdminController],
|
|
providers: [PaymentAnalyticsService, WebhookEventsService],
|
|
exports: [PaymentAnalyticsService, WebhookEventsService],
|
|
})
|
|
export class WebhooksModule {}
|