payment integration

This commit is contained in:
marshal
2026-06-15 11:09:58 +03:00
parent 484151d909
commit fe1bed8c4b
4 changed files with 6 additions and 3 deletions

View File

@@ -33,13 +33,13 @@ export class PaymentEntity extends BaseEntity {
@Column({ type: "jsonb", default: {}, name: "raw_initiation" })
rawInitiation?: Record<string, unknown>
@Column({ type: "jsonb", name: "client_action" })
@Column({ type: "jsonb", nullable: true, name: "client_action" })
clientAction?: Record<string, unknown>;
@Column({ type: "varchar", length: 255, unique: true, name: "merchant_order_id", })
merchantOrderId!: string
@Column({ type: "varchar", length: 255, unique: true, name: "transaction_id", })
@Column({ type: "varchar", length: 255, unique: true, nullable: true, name: "transaction_id", })
transactionId?: string
@Column({ type: "enum", enum: ["action-required", "processing", "success", "failed", "canceled", "refunded"], default: "action-required" })

View File

@@ -1,5 +1,6 @@
import { Injectable, Logger } from "@nestjs/common";
import { Nack, RabbitSubscribe } from "@golevelup/nestjs-rabbitmq";
import { Public } from "@edr/api-common";
import {
PAYMENT_EVENTS_DLX,
PAYMENT_EVENTS_EXCHANGE,
@@ -19,6 +20,7 @@ export class PaymentEventsConsumer {
constructor(private readonly paymentService: PaymentSvc) { }
@Public()
@RabbitSubscribe({
exchange: PAYMENT_EVENTS_EXCHANGE,
routingKey: paymentServiceBindingPattern(PaymentService.FREIGHT),

View File

@@ -187,6 +187,7 @@ export class PaymentService {
currency: booking.paymentCurrency,
reason: `Payment for booking ${booking.reference}`,
rawInitiation: snapshot as unknown as Record<string, unknown>,
clientAction: clientAction ?? {},
...data,
} as any);
}