Contents

Providers

The active provider is selected from the panel: Settings → Payment (notifications:settings permission).

Credentials live only in env; the panel does not store secrets.

ProviderEnv prefixDefault base
IyzicoPAYMENT_IYZICO_*sandbox-api.iyzipay.com
Moka UnitedPAYMENT_MOKA_*service.refmokaunited.com

Shared:

VariableDescription
PAYMENT_CALLBACK_URL3DS bank return; defaults to {AUTH_EMAIL_LINK_BASE_URL}/api/v1/payments/3ds/callback when empty
PAYMENT_FIELD_ENCRYPTION_KEYCard field AES-256-GCM (openssl rand -base64 32); required in production

Flow

BIN check → 3DS initialize → bank page → callback → 3DS auth (completion)
  1. BIN — first 6–8 digits of card; installment options
  2. Initialize — start 3DS with provider; returns HTML/redirect
  3. Callback — bank POST; server completes auth
  4. Auth / complete — transaction record updated (success / failure)

Client IP is taken from the server (c.IP()); client IP from the body is not accepted.

HTTP endpoints

Public (signature / bank)

MethodAPIWeb
POST/api/v1/payments/3ds/callback/payments/3ds/callback
POST/api/v1/payments/webhook/iyzico/payments/webhook/iyzico

Iyzico webhook: X-IYZ-SIGNATURE-V3PAYMENT_IYZICO_SECRET_KEY.

Protected (payments:charge / payments:list)

MethodPathPermission
POST/api/v1/payments/bin-checkcharge
POST/api/v1/payments/3ds/initializecharge
POST/api/v1/payments/3ds/authcharge
POST/api/v1/payments/calc-amountcharge
GET/api/v1/payments/transactionslist
GET/api/v1/payments/transactions/:referencecharge or list

Panel: /dashboard/payments/checkout, /dashboard/payments/transactions.

Resilience

  • Outbox / retry and reconciliation infrastructure integrated with payment use cases
  • Sensitive card fields via pkg/fieldenc + PAYMENT_FIELD_ENCRYPTION_KEY
  • Idempotency middleware on mutations (callback policy separate)

Settings API

MethodPath
GET/POST/api/v1/settings/payment
GET/PATCH/api/v1/settings/payment/:provider

Code

  • internal/application/payment
  • internal/infrastructure/payment
  • internal/adapters/http/handler/payment_handler.go
  • internal/adapters/goui (checkout / transactions screens)