Skip to content

iyzico Driver (PaymentsIyzico)

PaymentsIyzico (trk/processwire-payments-iyzico, v0.1.0) is the official iyzico REST v2 gateway driver for Payments, tailored for Turkish Lira (TRY) and regional card acquiring with 3D Secure, BIN installments, card storage, and marketplace sub-merchants. It registers lazily via 'paymentsDriver' => true with driver key iyzico.

Repository: github.com/trk/PaymentsIyzico

Terminal window
composer require trk/processwire-payments-iyzico
php vendor/bin/wire module:install PaymentsIyzico --json

Configure an instance in Setup -> Payments -> Gateways by selecting iyzico.

Setting Key Required Recommended Storage Purpose
api_key Yes $env:IYZICO_API_KEY iyzico merchant API key.
secret_key Yes $env:IYZICO_SECRET_KEY iyzico merchant secret key used by IyzicoAuthSigner for request signing and webhook verification.
sandbox_base_url Optional https://sandbox-api.iyzipay.com Sandbox REST v2 base URL validated by IyzicoHttpClient::validateBaseUrl().
live_base_url Optional https://api.iyzipay.com Production REST v2 base URL.
default_locale Optional tr or en Locale forwarded to iyzico Checkout Form and API error responses.

Totoglu\PaymentsIyzico\IyzicoGateway implements PaymentGatewayInterface, SavedSourceGatewayInterface, InstallmentGatewayInterface, SubscriptionGatewayInterface, MarketplaceGatewayInterface, WebhookGatewayInterface, and TransactionStatusGatewayInterface.

  • Payment Modes & Basket Parity (IyzicoBasketBuilder): Supports direct card, 3DS (/payment/3dsecure/auth), Checkout Form (/payment/iyzipos/checkoutform/auth/ecom/detail), saved cards (/cardstorage/card), full/partial refunds, and /payment/cancel voids. IyzicoBasketBuilder::assertParity() guarantees sum(basketItems[].price_minor) === paidPrice_minor using Currency’s largest-remainder Money::allocate().
  • BIN Installments (queryInstallments()): Queries 6+ digit card BIN installment matrices returning typed InstallmentOption arrays.
  • Subscriptions & Card Update Portal: Supports /v2/subscription/initialize, Checkout Form subscription initialization, /upgrade plan switching, /activate, /cancel, getSubscriptionDetails(), and native card-update Checkout Forms via customerPortalUrl() (while $payments->customerPortalUrlForUser() serves the signed local /_payments/portal/{token} hub). Note that upstream iyzico does not support pausing subscriptions (pauseSubscription() throws WireException).
  • Marketplace Sub-Merchants: Onboards sub-merchants via POST /onboarding/submerchant (subMerchantKey), maps PaymentIntentRequest::$splits to basketItems[].subMerchantKey / subMerchantPrice, and approves payouts via POST /payment/iyzipos/item/approve.

IyzicoAuthSigner::verifyWebhookSignature() validates the X-IYZ-SIGNATURE-V3 header for both payment and subscription payloads and enforces replay tolerance (webhook_tolerance_seconds, default 300 seconds) when iyziEventTime is present.

Next steps