payments event
This commit is contained in:
@@ -6,7 +6,7 @@ import { GatewayManager } from '../gateways/gateway.manager';
|
||||
import { OrderPaymentContext } from '../interface/payment';
|
||||
import { PaymentMessage, OrderMessage } from 'src/common/enums/message.enum';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { onlinePaymentSucceedEvent, paymentSucceedEvent } from '../events/payment.events';
|
||||
import { onlinePaymentSucceedEvent, newCashPaymentEvent } from '../events/payment.events';
|
||||
import { OrderService } from 'src/modules/order/providers/order.service';
|
||||
import { PayOrderDto } from '../dto/pay-order.dto';
|
||||
import { PaymentRepository } from '../repositories/payment.repository';
|
||||
@@ -147,11 +147,11 @@ export class PaymentService {
|
||||
|
||||
await em.persistAndFlush([payment, newCreditTransaction]);
|
||||
});
|
||||
|
||||
this.eventEmitter.emit(
|
||||
paymentSucceedEvent.name,
|
||||
new paymentSucceedEvent(ctx.invoice.id, String(ctx.invoice?.invoiceNumber) || '', ctx.method, ctx.amount),
|
||||
);
|
||||
//TODO
|
||||
// this.eventEmitter.emit(
|
||||
// newCashPaymentEvent.name,
|
||||
// new newCashPaymentEvent(ctx.invoice.id, String(ctx.invoice?.invoiceNumber) || '', ctx.method, ctx.amount),
|
||||
// );
|
||||
}
|
||||
|
||||
private async handleOnlinePayment(ctx: OrderPaymentContext): Promise<{ paymentUrl: string }> {
|
||||
|
||||
Reference in New Issue
Block a user