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.

Payment flow

  1. GET /api/payment-methods — list available methods (optional)
  2. POST /api/payments — create payment, receive redirect_url
  3. Redirect payer to /pay/:id
  4. Payer selects method (if needed) and clicks Approve / Fail / Cancel
  5. Redirect to success_url, failed_url or cancel_url with payment_id and status
  6. Optionally: ITN (itn_url) and webhook (webhook_url)

Payment statuses

StatusDescription
pendingPayment created, waiting for action on hosted page
processingGateway released the payer — no final confirmation yet (ITN flow)
succeededPayment completed successfully
failedPayment declined
cancelledPayment 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.

  1. Payer clicks Approve on hosted page
  2. Immediate redirect: success_url?payment_id=...&status=processing
  3. After itn_delay_seconds (default 0) — POST to itn_url
  4. After successful ITN — status becomes succeeded and 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.