Ahmed Hassan
All workCase Study

Payment Gateway Integrations

Stripe & Moyasar integrations with idempotent webhooks, invoicing and refunds — payment flows engineered to survive edge cases, not just the happy path.

StripeMoyasar
Payment Gateway Integrations
Client
Multiple platforms needing real payment rails
Duration
2-4 weeks per integration
My role
Backend — payments specialist

How it happened

01
The Beginning

"Just add Stripe" is never just that

Clients usually ask for payments as a single checkbox in a bigger scope — until the first refund request, the first failed webhook, or the first customer who got charged twice by accident.

02
The Challenge

Money can't be 'mostly correct'

Payment integrations fail in ways that are invisible until they cost someone money: a webhook retried twice can double-charge a customer, and a race condition in refund logic can quietly drain trust in the whole platform.

03
How We Solved It

Idempotent by default, tested on purpose

I build every webhook handler to be idempotent from the start — a retried event can never double-charge anyone — and deliberately test the unhappy paths: failed payments, partial refunds, expired sessions, not just the demo-ready happy path.

04
The Result

Payment flows that survive real customers

Every integration I've shipped has run in production without a duplicate-charge incident — the kind of reliability that's invisible when it works, and very visible when it doesn't.

0Double-charge incidents
2Gateways integrated (Stripe, Moyasar)
100%Idempotent webhook handling

Want something like this?

Tell me about your project and I'll get back to you within hours.

Build something like this
Let's work togetherFreelanceFull-timeRemote friendlyLet's work togetherFreelanceFull-timeRemote friendly