Payment Gateway Integrations

Secure integration of third-party payment gateways and verification modules into custom PHP and Laravel applications and e-commerce platforms, built so a payment is never lost, double-counted or trusted without verification.

Production work (private code)API Integration
Illustration of the Payment Integrations project
SHA256
checksum / HMAC verification
Webhooks
idempotent handlers
Fallback
verification polling
Audit logs
every transaction

The challenge

Payment code has to survive the messy parts of real life: customers closing the tab before the redirect returns, gateways sending the same webhook twice, callbacks arriving before your own page loads, and attackers forging a success notification.

The goal was zero-drop verification, no double-charge or double-credit, and the ability to answer 'what happened to this payment?' from the logs.

How I approached it

  1. 01

    Signed requests and verified responses

    API requests are authenticated and signed, and every response or callback is checksum-verified (SHA256 / HMAC) before an order or wallet is updated. A success flag from the browser is never trusted on its own.

  2. 02

    Idempotent webhook handlers

    Webhook endpoints check for duplicates, so a gateway retrying the same notification can't mark an order paid twice or credit a wallet twice.

  3. 03

    Fallback verification

    If the customer never returns from the gateway redirect, a fallback routine checks payment status with the gateway directly, catching edge-case drop-offs.

  4. 04

    Full transaction audit trail

    Each payment lifecycle is logged. No raw card data is stored: the gateway handles card details and the application keeps only references and statuses.

What I built

  • Implemented API authentication, request signing and response checksum validation.
  • Built secure webhook endpoint handlers with duplicate-request idempotency checks.
  • Built fallback verification routines for drop-offs during gateway redirects.
  • Kept strict security practice: no raw card credentials stored, full transaction logs maintained.
Gateway and client details stay private, but the same ideas (idempotency, verification, ledgers) are demonstrated in public code in the FinCore case study.

What this project demonstrates

  • Treating every callback as untrusted until verified
  • Idempotency as a default, not an afterthought
  • Debugging payment flows end to end from logs

Related case studies

Laravel 12 / MySQL 8 / Redis / REST APIOpen Source

FinCore: Wallet & Double-Entry Ledger API

A versioned REST API for digital wallets where every credit, debit, transfer and reversal produces balanced ledger entries and a full audit trail. Built to show how money-handling code should behave when requests are retried, concurrent or malicious.

Laravel / PHP / MySQL / REST APIProduction ยท Private

PractiCal Backend Platform

A production backend serving meal-subscription operations: user profiles, multi-tier subscription plans, custom meal schedules, digital wallets, order histories and automated kitchen and delivery dispatch lists.

Have a project like this in mind?

Tell me what you're building. I'll reply by email with questions or a suggested approach.