MPMark Angelo Pagtalunan
← All work

Payments

Unified online payment API

One hosted-checkout API in front of three Philippine payment gateways, with verified webhooks as the source of truth.

Role
Sole developer
When
Jul – Aug 2026
Stack
Next.js, TypeScript, Route Handlers, zod, Firestore, PayMongo, Xendit, Bux

Overview

Each product on the platform used to integrate a payment gateway on its own. This service replaces that with a single endpoint: send an amount, a reference and a provider name, and get back a checkout URL to redirect the customer to.

It is built on the Next.js App Router. Each gateway sits behind the same adapter interface, so adding a provider does not change what callers send.

Engineering notes

The redirect is not proof

A customer landing on the success page proves nothing. Fulfilment happens only when a signed webhook arrives, and the handler is idempotent because gateways deliver the same event more than once.

Units are a contract

Callers send pesos. Adapters convert to whatever each gateway expects, including centavos, so no caller can be off by a factor of 100.

Used by other services

The insurance API creates its checkouts here and receives the payment callback back, which kept payment logic out of that service entirely.

Next projectFlight booking services →