Project

Pagamentos — do Oracle aos Bancos

Pix (Brazil's instant payments), online slip registration at two banks and card recurrence served by a 2011-generation Oracle database that can't negotiate the TLS modern bank APIs demand — the workaround: tiny Node middlewares doing the modern handshake.

What do you do when the database can't speak the TLS of modern applications? Replacing the database is impossible; outsourcing is expensive. The real answer is a few dozen lines long: one Node process per API, accepting plain HTTP on the inside and speaking whatever dialect each bank demands on the outside — mTLS, OAuth, SOAP or JSON.

Illustration: a database cylinder linked to bank icons through a small amber node with a padlock, representing the TLS-handling middleware; dark theme.

The institution's financial core runs on a 2011-generation Oracle — the same one from the PL/SQL case — and needs to talk to today's banking APIs: Pix, online slip registration, recurring card subscriptions. These APIs demand recent TLS, client certificates (mTLS) and OAuth — handshakes the HTTP client of a database from that generation simply cannot negotiate.

The workaround lives on an internal VM: one Node middleware per bank API. The PL/SQL keeps doing what it always did — build the payload and make a plain HTTP call inside the network — and the middleware adds whatever that API's contract demands: an OAuth token refreshed on every call where there's OAuth, the institution's digital certificate in the mTLS handshake where the bank requires it, SOAP/XML where the contract is legacy — and returns the raw response for the database to decide. The Pix one exposes two generic routes (authenticated PUT and GET); the recurrence one covers the whole customer/plan/subscription cycle in ~22 operations — cancellation, charge projection, card replacement, date and amount changes, plan migration —; the slip ones are ~50 lines each.

Auditing lives where finance lives: every call writes the full request and response to a table in Oracle itself, with status and error detail. When something fails, the investigation starts in the database, with the exact payload of the moment — no hunting logs on servers.

In 2026 one of the financial institutions deactivated its legacy certificate stack and Pix generation stopped. The request log pointed to the rejection at the bank's door; the fix was renewing the digital certificate — zero lines of code changed. A thin middleware has that virtue: there's almost nowhere for a bug to live.

By the numbers

4
Bank APIs served
~22
Recurrence operations
49
Lines in the smallest one
0
Code changed in the incident

Engineering decisions

  1. 01

    A translator, not a platform

    Each bank API gets its own tiny, independent process — no shared framework, no coupled deploys. When a bank changes its contract, you touch one file; when one service goes down, the others never notice. The temptation to generalize into a "payments gateway" was refused on purpose: four small translators are easier to audit than one platform.

  2. 02

    TLS lives in the middleware; the business, in PL/SQL

    The Node process decides nothing: it takes a URL and payload, adds the authentication that contract demands, and returns the response. The financial rules — who can create a charge, for how much, what to do with the answer — stay in the packages where they always lived, auditable in the same place as always. Separating the handshake from the decision is what keeps the middlewares thin.

  3. 03

    Auditing inside the database

    Every call writes the full request and response, with status and detail, to a table in Oracle itself. Diagnosing any failure starts with the exact payload of the moment — including August's incident, which was solved by reading that table, not by hunting server logs.

  4. 04

    The incident solved with no code

    When the financial institution switched off its legacy certificate stack, the fix was operational: renew the digital certificate and restore the flow — zero lines changed. A middleware's thickness is a risk decision: the less it does, the fewer places there are to break when the world on the other side changes.

Architecture

PL/SQL

Builds and calls

The financial package posts plain HTTP on the internal network.

Middleware Node

OAuth + mTLS

Whatever each contract demands: OAuth token, digital certificate.

APIs bancárias

Pix · Slips · Recurrence

Four APIs, each with its own contract — and its own translator.

Auditoria

In Oracle itself

Full request and response, with status, in a database table.

Stack

Node.jsExpressAxiosOAuth 2.0 / mTLSOracle PL/SQL