This commit is contained in:
marshal
2026-06-30 06:15:57 +03:00
parent c501effc32
commit dd9a7e639a
2 changed files with 3 additions and 1 deletions

View File

@@ -492,7 +492,8 @@ export class BillingService {
// the domain never supplies it. New sources add their uppercased value to
// the PaymentReferenceType enum.
referenceType: invoice.source.toUpperCase() as PaymentReferenceType,
orderRef: invoice.invoiceNumber,
// orderRef: invoice.invoiceNumber,
orderRef:Date.now().toString(),
amountMinor: Math.round(Number(invoice.totalAmount)),
currency: invoice.currency,
reason: `Payment for invoice ${invoice.invoiceNumber}`,

View File

@@ -465,6 +465,7 @@ export class PaymentService {
failureCode?: string;
failureMessage?: string;
}): Promise<{ processed: boolean; alreadyFinalized?: boolean; reason?: string }> {
console.log(`Received payment event: ${JSON.stringify(event)}`);
if (event.eventType === "payment.succeeded") {
console.log(`Payment succeeded event received for reference ${event.referenceId}`);
const intent = await this.paymentRepo.findOneBy({ refId: event.referenceId });