mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 16:28:12 +00:00
changes
This commit is contained in:
@@ -479,7 +479,7 @@ export class PaymentService {
|
||||
alreadyFinalized?: boolean;
|
||||
reason?: string;
|
||||
}> {
|
||||
console.log(`Received payment event: ${JSON.stringify(event)}`);
|
||||
this.logger.log(`Received payment event: ${JSON.stringify(event)}`);
|
||||
if (event.eventType === "payment.succeeded") {
|
||||
const intent = await this.paymentRepo.findOneBy({
|
||||
refId: event.referenceId,
|
||||
@@ -490,13 +490,12 @@ export class PaymentService {
|
||||
reason: `No local intent for reference ${event.referenceId}`,
|
||||
};
|
||||
}
|
||||
console.log(`Processing payment succeeded event for intent: }`, intent);
|
||||
const { alreadyFinalized } = await this.markIntentSucceeded(intent.id, {
|
||||
providerTxnId: event.providerTxnId,
|
||||
paidAt: event.paidAt ? new Date(event.paidAt) : undefined,
|
||||
notify: true,
|
||||
});
|
||||
console.log(
|
||||
this.logger.log(
|
||||
`Payment finalized for intent ${intent.id}, alreadyFinalized: ${alreadyFinalized}`,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user