PayX.uz
Payment infrastructure for digital products.
In plain words
- What it is
- A service that lets a website or app take payments through Payme, Click, Xazna and Oson by connecting just one system.
- Who it’s for
- Owners of online shops and online services, and their developers.
- What it gives
- No need to connect every payment system separately. The seller issues an invoice, the buyer pays the way they prefer, and the seller automatically gets a confirmation and sees every payment in one dashboard.
PayX is a payment integration platform that lets digital businesses accept payments through one developer API. Merchants create invoices, receive reliable callbacks and track every transaction and commission from a single dashboard.
Business context
Small online businesses sell through Telegram and Instagram and need to accept payments without integrating every payment provider themselves.
The problem
Integrating payments directly is slow and risky for small teams: each provider has its own protocol, callbacks fail or arrive twice, and reconciling commissions and transactions turns into manual work.
The solution
A Laravel platform that sits between merchants and payment processing — a clean REST developer API, invoice management, verified callbacks to merchants, commission calculation and a complete transaction history.
What I built
Built alone — architecture, code and production. No other developers worked on it.
Architecture
- One invoice model in front of four providers: Payme, Click, Xazna, OSON
- Signed, retried webhooks to merchant backends
- A sandbox that simulates payments
Backend
- Merchant API v1.2 (OpenAPI 3.0.3) on Laravel
- Invoice lifecycle: pending → paid or cancelled
- Commission as a percentage per payment provider, withheld from the merchant and never added to the payer’s amount
Frontend & apps
- Merchant cabinet for payment links and payouts
- A pay page where the customer chooses a provider
- Public API documentation and a Postman collection
APIs & integrations
- Payme, Click, Xazna, OSON
- payment.completed webhook signed with HMAC-SHA256
- Sign-in with My-IT
Database
- MySQL: invoices, payments and provider transaction IDs
Security
- A Bearer token per project
- HMAC over timestamp and body, a ±5-minute window and constant-time comparison
- Webhook delivery does not follow redirects
Delivery & operations
- Separate sandbox and production tokens
- Webhook retries: immediately, then after 30 s, 2 min, 10 min and 30 min, with a 10 s timeout
Engineering deep dive: Invoice lifecycle — from link to webhook
- The merchant’s backend creates an invoice with POST /invoice using its project token.
- PayX returns the invoice uuid and a pay_url; the status is “pending”.
- The customer opens the pay_url and chooses a provider.
- PayX starts the payment with Payme, Click, Xazna or OSON.
- The provider confirms the payment and returns its transaction ID.
- The invoice becomes “paid” and the commission is recorded.
- PayX sends a payment.completed webhook signed with HMAC, retrying up to five times.
- The merchant can confirm the state at any time with GET /invoice/{uuid}.
Technical decisions & trade-offs
- One invoice, four providers — Merchants create one invoice; the customer chooses Payme, Click, Xazna or OSON on the pay page. (Trade-off: PayX depends on every provider’s availability — but merchants integrate once.)
- Signed webhooks with a time window — Each webhook carries an HMAC of timestamp and body; old timestamps are rejected. (Trade-off: Merchants must verify signatures and keep their clocks right — the docs show how.)
- Retries with an idempotency key — Delivery is retried up to five times, and invoice_uuid is the idempotency key, so a repeated webhook changes nothing. (Trade-off: A merchant may receive the same event twice and must deduplicate by invoice_uuid.)
- Only success is pushed — Only payment.completed is sent; cancellation and expiry are read with GET /invoice/{uuid}. (Trade-off: Simpler webhook handling, but merchants check other states themselves.)
Core modules
- Payment processing integration
- Invoice management
- Merchant integration
- Payment callbacks
- Commission management
- Financial transaction tracking
- Developer API
payx.uz
Boburbek