professional ★ Featured

Travel, Miles & Loyalty Platform (123 Milhas)

PHP Developer

Core back-end PHP engineering on 123 Milhas' high-traffic travel and miles platform; multi-programme loyalty wallet (HotMilhas), P2P miles marketplace with escrow, multi-gateway payment processing (PIX, Cielo, PagSeguro), and a PHP 5.X 8.1 production platform modernisation.

Completed May 2021

Key Impact

  • PHP 5.x → 8.1 migration with zero downtime
  • P95 API latency reduced 40% via index & query rewrites
  • Multi-gateway payment layer unifying PIX, Cielo, PagSeguro

Core back-end PHP engineering on 123 Milhas and HotMilhas — Brazil’s largest travel and miles platform.


Backend & Modernisation (PHP 5.X → 8.1):
• PHP — Upgraded the full production platform from 5.X to 8.1; PSR, and modern syntax enforced across all modules.
• SQL Server — Schema normalisation, composite indexes, and stored procedure rewrites to hit P95 latency targets on APIs.
• MVC Architecture — Monolith decomposed into bounded service modules (loyalty, payments) with clear interfaces.


Miles & Loyalty Wallet (HotMilhas):
• Multi-programme wallet — LATAM Pass, Smiles/GOL, and TudoAzul balances aggregated with real-time mile valuations.
• P2P miles marketplace — Real-time quotation engine;
• Bank loyalty bridge — OAuth integrations covering Livelo, Esfera, Itaucard, and Superdigital with async polling and retry logic.


Payments & Transactions:
• Multi-gateway payment layer — Cielo, PagSeguro, PIX, and boleto bancário unified behind a single interface.
• Automated payout engine — PIX and bank-transfer disbursements triggered on airline-confirmed transfers.
• Fraud prevention — Velocity checks, device-fingerprint scoring, and rule-based validation at the service boundary.


REST API:
• Versioned endpoints — Loyalty, miles, and financial reporting APIs with token auth, rate limiting, and idempotency keys.
• OpenAPI documentation — Formal spec with sequence diagrams as the integration contract for internal teams and partners.


Executive Pricing Dashboard:
• Planning & architecture — Designed a real-time monitoring dashboard tracking live prices on Loyalty and R$Real conversion rate.
• Data ingestion — Scheduled live database polling feeding a normalised price store, refreshed on configurable intervals.
• Decision-making layer — Aggregated price trends and competitor deltas surfaced as charts and alerts for C-level and commercial executives.


Infrastructure:
• Load balancer — Health-check routing for zero-downtime deployments under peak traffic.
• Cron pipeline — Scheduled jobs for reconciliation, airline API polling, and financial batch exports.

Technologies Used

PHP SQL Server REST API JavaScript Bootstrap jQuery Cielo PagSeguro PIX Livelo API LATAM Pass API Smiles API Load Balancer Cron MVC

Case Study

Problem

123 Milhas needed to migrate a PHP 5.x monolith to 8.1 while handling millions of BRL in live transactions without downtime.

Context

Brazil's largest travel and miles platform — peak traffic during airline sales, complex loyalty wallet integrations, and a fragile legacy codebase.

Constraints

Zero-downtime requirement, live payment SLAs, no existing unit tests, and aggressive timelines driven by PHP 5.x EOL.

Architecture Decision

Incremental strangler-fig migration: bounded service modules extracted one at a time (loyalty, payments, marketplace), each covered with tests before go-live.

Tradeoffs

Chose incremental extraction over a full rewrite, accepting short-term dual-stack complexity to keep revenue flowing throughout migration.

Outcome

Full production migration to PHP 8.1 complete; payment layer handling millions monthly with improved fraud detection and zero regression incidents.

Implementation Highlights

  • Wrote migration tooling to shim PHP 5 global functions and deprecated APIs
  • Normalised SQL Server schema and rewrote stored procedures — P95 latency dropped 40%
  • Unified Cielo, PagSeguro, PIX, and boleto behind a single payment interface