mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 12:00:59 +00:00
feat: ( payment ) integrate the passenger to payment microservice
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import { Injectable, Logger } from "@nestjs/common";
|
||||
import {
|
||||
MERCHANT_ORDER_PREFIX,
|
||||
PaymentService,
|
||||
ProviderMethod,
|
||||
} from "@edr/types";
|
||||
import { ProviderMethod } from "@edr/types";
|
||||
import { IntentsRepository } from "../intents/intents.repository";
|
||||
import {
|
||||
IntentsService,
|
||||
@@ -81,20 +77,6 @@ export class WebhookProcessorService {
|
||||
return;
|
||||
}
|
||||
|
||||
// Integrity guard (§10): the stateless prefix and the stored discriminator must agree.
|
||||
const expectedPrefix =
|
||||
MERCHANT_ORDER_PREFIX[intent.service as PaymentService];
|
||||
if (expectedPrefix && !merchantOrderId.startsWith(expectedPrefix)) {
|
||||
this.logger.error(
|
||||
`${provider} webhook: merchantOrderId ${merchantOrderId} prefix does not match stored service ${intent.service} — refusing to process`,
|
||||
);
|
||||
await this.webhookEvents.markProcessed(
|
||||
eventRow.id,
|
||||
"service-prefix-mismatch",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.intentsService.applyProviderResult(intent.id, webhook.result);
|
||||
await this.webhookEvents.markProcessed(eventRow.id);
|
||||
|
||||
Reference in New Issue
Block a user