Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m12s
CI/CD Pipeline / Security Scanning (push) Successful in 2m21s
CI/CD Pipeline / Lint and Format (push) Failing after 36s
CI/CD Pipeline / Terraform Validation (push) Failing after 22s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 25s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 23s
Validation / validate-genesis (push) Successful in 26s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-security (push) Failing after 1m15s
Validation / validate-documentation (push) Failing after 15s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 26s
Verify Deployment / Verify Deployment (push) Failing after 56s
Add operator settlement terminal UI/API, swift-listener service, compliance idempotency gates, GRU reserve dashboards, and @dbis/integration-foundation for typed HYBX/ISO adapter contracts. Co-authored-by: Cursor <cursoragent@cursor.com>
58 lines
1.9 KiB
JavaScript
58 lines
1.9 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.MockHybxClient = void 0;
|
|
const payments = new Map();
|
|
class MockHybxClient {
|
|
environment;
|
|
constructor(environment = 'sandbox') {
|
|
this.environment = environment;
|
|
}
|
|
async initiatePayment(request) {
|
|
const paymentId = `mock-pay-${request.idempotencyKey.slice(0, 16)}`;
|
|
const existing = payments.get(request.idempotencyKey);
|
|
if (existing)
|
|
return existing;
|
|
const response = {
|
|
paymentId,
|
|
status: 'accepted',
|
|
uetr: `mock-uetr-${paymentId}`,
|
|
messageId: `mock-msg-${paymentId}`,
|
|
createdAt: new Date().toISOString(),
|
|
rawReference: request.endToEndId,
|
|
};
|
|
payments.set(request.idempotencyKey, response);
|
|
payments.set(paymentId, response);
|
|
return response;
|
|
}
|
|
async getPaymentStatus(paymentId) {
|
|
const found = payments.get(paymentId);
|
|
if (!found) {
|
|
return {
|
|
paymentId,
|
|
status: 'pending',
|
|
createdAt: new Date().toISOString(),
|
|
};
|
|
}
|
|
return found;
|
|
}
|
|
async listSettlementEvents() {
|
|
return Array.from(payments.values()).map((p) => ({
|
|
eventId: `evt-${p.paymentId}`,
|
|
paymentId: p.paymentId,
|
|
status: p.status,
|
|
settlementDate: new Date().toISOString().slice(0, 10),
|
|
timestamp: new Date().toISOString(),
|
|
}));
|
|
}
|
|
parseWebhookPayload(body) {
|
|
const parsed = JSON.parse(body);
|
|
return {
|
|
eventType: String(parsed.eventType ?? 'payment.status'),
|
|
eventId: String(parsed.eventId ?? `wh-${Date.now()}`),
|
|
timestamp: String(parsed.timestamp ?? new Date().toISOString()),
|
|
data: parsed.data ?? parsed,
|
|
};
|
|
}
|
|
}
|
|
exports.MockHybxClient = MockHybxClient;
|