Sandbox Payments · v1.1.0
Payment gateway sandbox
Minimal Stripe/PayU-like sandbox for integration testing.
Base URL: https://payments.ibiyahe.com
About
Sandbox Payments simulates an external payment gateway. A merchant creates a payment via API,
redirects the payer to a hosted page (/pay/:id), and after user action
the payer is redirected back with optional HTTP notifications.
- Stack: Go + SQLite + stdlib HTTP
- Amounts in minor units (e.g.
1999= 19.99 PLN) - Methods:
card,blik,google_pay,bank_transfer
Payment flow
GET /api/payment-methods— list available methods (optional)POST /api/payments— create payment, receiveredirect_url- Redirect payer to
/pay/:id - Payer selects method (if needed) and clicks Approve / Fail / Cancel
- Redirect to
success_url,failed_urlorcancel_urlwithpayment_idandstatus - Optionally: ITN (
itn_url) and webhook (webhook_url)
Payment statuses
| Status | Description |
|---|---|
pending | Payment created, waiting for action on hosted page |
processing | Gateway released the payer — no final confirmation yet (ITN flow) |
succeeded | Payment completed successfully |
failed | Payment declined |
cancelled | Payment cancelled by payer |
ITN — Instant Transaction Notification
Optional itn_url simulates a scenario where the gateway releases the payer
(redirect to success_url with status=processing) before final confirmation.
- Payer clicks Approve on hosted page
- Immediate redirect:
success_url?payment_id=...&status=processing - After
itn_delay_seconds(default 0) — POST toitn_url - After successful ITN — status becomes
succeededand webhook is sent (if configured)
{
"event": "payment.processing",
"payment_id": "pay_abc123",
"amount": 1999,
"currency": "PLN",
"status": "processing"
}
Webhooks
Optional webhook_url receives a POST when a final status is reached
(succeeded, failed, cancelled).
{
"event": "payment.succeeded",
"payment_id": "pay_abc123",
"amount": 1999,
"currency": "PLN"
}
Events: payment.succeeded, payment.failed, payment.cancelled. Retry: 3 attempts.