Blog/ECWS Payment Workflow Before and After Migration
temp2026-11-18

ECWS Payment Workflow Before and After Migration

How a payment request reaches Core and how its receipt can be retried independently.

I worked on the ECWS payment orchestration service used by banks and credit unions. I refactored the orchestration module into a Java and Spring Boot service and moved receipt email delivery out of the payment request path.

How ECWS routes a request

ECWS reads requestType to choose a workflow. These are five examples. During the migration, we kept the existing logic for the other request types because we hadn't observed a bottleneck in those flows.

  1. The orchestration service receives the business request.
  2. The type selects one branch. Several branches can also populate a memo. For example, CLNC uses credit-limit details, while PAY uses the payment amount. The REST label here is a business code for restriction-related data.
  3. For PAY, ECWS calls Core to execute the payment. The diagrams below follow that branch before and after migration.

Before migration

  1. The client submits a payment request to DataPower.
  2. DataPower authenticates the request, applies rate limits, and routes it to ECWS.
  3. ECWS calls Core to execute the payment.
  4. Core returns the payment result to ECWS.
  5. ECWS prepares the client response and sends it back to DataPower.
  6. DataPower returns the response to the client.

After migration · Successful receipt

  1. Receive the payment. DataPower still handles authentication, rate limiting, and routing.
  2. Route both protocols through the translation service. DataPower forwards every SOAP and REST request to the SOAP to REST Translation Service. It converts SOAP requests to REST (2a) and passes native REST requests through unchanged (2b). Both paths reach fs-internal-service as REST.
  3. Call Core. The orchestration service calls Core and waits for the payment result.
  4. Record the outcome. After Core responds, the service writes the workflow record to Oracle. When a receipt is due, it writes an outbox event in the same transaction. The client can receive its payment response without waiting for email delivery.
  5. Publish the receipt event. Change data capture (CDC) picks up the committed outbox record and publishes it to Kafka.
  6. Request email delivery. The email consumer sends the notification ID with the receipt request. Infra records the send status under that ID. Infrastructure handles SMTP delivery after the API accepts the request.
  7. Record send success. Once the email API accepts the send, the consumer writes the notification’s success status to Oracle and waits for that write to commit.
  8. Commit the offset. The consumer then commits its offset to Kafka for the processed record.

Receipt retry workflow

  1. On a retryable send failure, the email consumer publishes the notification to the retry topic.
  2. The retry consumer picks it up after backoff.
  3. Retry consumers check the shared breaker state in Redis. While OPEN, the notification stays pending. After cooldown, the consumer checks again.
  4. When CLOSED, the retry consumer checks Infra’s record using the original notification ID. If Infra already sent the receipt, the consumer skips the send and goes to 5a. It calls the send API only when Infra confirms the receipt is unsent. An inconclusive lookup leaves the outcome pending.
  5. After a confirmed prior send or a newly accepted send, the retry consumer records success in Oracle, then commits the retry record’s offset (5a). On another retryable failure, it schedules the next attempt or sends the exhausted notification to the dead-letter topic (5b).

The notification consumer stops at the dead-letter topic. A separate service handles reconciliation later. The payment has already completed.