Payment Microservice - Airwallex
Backend microservice and custom TypeScript SDK powering Airwallex payment integrations.
- Node.js
- Express.js
- TypeScript
- MySQL
- MongoDB
- Sequelize
- Redis
- SQS
- Axios
- Slack
- Sentry
- Jest
Node.js microservice for Airwallex payment integration, serving as the backend for both the admin and merchant platforms across Singapore and Australia. I built the internal TypeScript SDK, SQS-based webhook processing system, auth layer, bank beneficiary integration, and platform account management - all from scratch.
Highlights
- Built a versioned internal TypeScript SDK for the Airwallex REST API (v2025-11-11) - Airwallex has no stable Node.js SDK. Covers platform accounts, connected accounts, payment intents, beneficiaries, hosted flows, RFIs, and terminal devices with full type definitions and a single controlled import surface.
- Designed the SDK auth system: proactive token refresh with a 2-minute lookahead, concurrent request deduplication via a shared login promise (no duplicate auth calls under load), automatic 401 retry with cache invalidation, and a pluggable TokenCache interface for future Redis-backed implementations.
- Built the SQS-based webhook processing system - 10 domain queues covering payments, payouts, onboarding, capabilities, disputes, fund splits, refunds, and terminal events. Long-poll listeners with backoff, dual persistence (MySQL for structured data, MongoDB for raw webhook payloads), and per-event DLQ retry.
- Implemented a real-time Slack notification system with two separate alert channels: infrastructure errors (SQS exceptions, DB failures, unhandled errors with full stack traces) and business events (account activation, suspension with reason codes, RFI action-required alerts).
- Built the full bank integration (beneficiary management) - create, update, delete, and set-default for payout bank accounts, scoped per connected account with masked account number handling in API responses.
- Built platform account and connected account management - full lifecycle including KYC/KYB submission, suspend and reactivate flows, payment capability tracking per method (Visa, Mastercard, Apple Pay, and more) with audit history, and webhook-driven status transitions stored with full history.
Last updated: 2026-06-06