Bank integration

Implement the bank adapter boundary: validate MEMEH instructions, execute bank-side flows, and publish authoritative lifecycle callbacks.

Inbound instructions Execution Callbacks UAT readiness

Adapter responsibilities

The adapter is the bank-controlled integration surface. It must be strict at the boundary and reliable in downstream execution and reporting.

Responsibility Expectation Failure behavior
Boundary verification Validate MEMEH signature and required headers before any processing. Reject immediately with explicit error code; do not forward downstream.
Schema validation Enforce request shape and required field rules consistently across environments. Reject with validation errors suitable for triage (field + reason).
Canonical translation Map canonical instructions into bank-side messages and internal workflows. Fail closed; emit callback with a terminal failure when translation is not possible.
Execution / forwarding Execute locally or forward to switch/rails while preserving instruction traceability. Handle timeouts deterministically; avoid duplicate execution on retries.
Authoritative callbacks Publish lifecycle updates to MEMEH for intermediate and terminal states. Retry-safe delivery; idempotent update semantics; never “drop” terminal outcomes.
Reliability requirement

MEMEH may retry delivery under network failure. The adapter must treat inbound instructions and callback deliveries as idempotent.

Operational posture

Treat signature failures, replay failures, and idempotency conflicts as security and integrity events.

Evidence to maintain
Structured logs with instruction_id correlation
Audit trail for credential access and rotations
Runbooks for retry storms and adapter downtime

Required capabilities

Minimum endpoints and behaviors required for bank participation.

Inbound instruction endpoint

Receives signed instructions from MEMEH. Must validate signature, request shape, and replay controls before processing.

Returns deterministic outcomes: accepted for processing or rejected with explicit reason codes.
Callback endpoint

Publishes authoritative status updates back to MEMEH. Must be reliable, idempotent, and retry-safe.

Emits intermediate states when available and terminal outcomes for all instructions.

Security requirements

Validate signatures, timestamps, and nonces. Store secrets securely and rotate through controlled operational procedures.

Signature validation

Reject instructions when signature mismatches. Invalid instructions must not proceed into execution.

Replay protection

Enforce timestamp skew and nonce uniqueness where required. Persist observed nonces within the configured window.

Secret management

Store secrets in a vault/HSM where available, restrict access by role, and rotate on schedule and on incident.

Callback model

Callbacks are the authoritative record of execution outcomes. Field rules and allowed statuses are defined in API Reference.

JSON
{
  "instruction_id": "123",
  "status": "approved",
  "payment_status": "paid"
}
Delivery contract
Rule Why it exists
Reference instruction_id Ensures unambiguous correlation to the original instruction.
Idempotent updates Allows safe retries and prevents state corruption.
Terminal outcomes must be emitted Prevents “hanging” instructions in client/operator views.
Signed callbacks (where required) Preserves integrity across the bank↔MEMEH boundary.
Timing

Emit callbacks as state changes occur (not only at settlement) to keep lifecycle visibility accurate.

Certification

Minimum UAT scenarios required for adapter readiness. Evidence should be reproducible and auditable.

Scenario Expected behavior Evidence
Valid instruction (happy path) Accept, execute/forward, and publish complete callback sequence including terminal outcome. Logs + callback payloads + trace correlation.
Invalid signature Reject at boundary; do not execute; return explicit error code. Error response + audit event.
Callback validation Callbacks reference the instruction_id and are idempotent under re-delivery. Duplicate-delivery test results.
Timeout handling Deterministic timeouts; avoid duplicate execution; publish final status when resolved. Timeout traces + eventual outcome callbacks.
Adapter downtime + retries Safe handling of retries after recovery; no double execution; callbacks resume correctly. Recovery runbook + test replay logs.
Acceptance criteria

The adapter demonstrates correctness, reliability, and consistent callback behavior across all UAT scenarios prior to production enablement.

© 2026 MEMEH — Mutual Enterprise Messaging Exchange Hub
Developer & Integration Portal