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
Installation
Section titled “Installation”composer require trk/processwire-payments-iyzicophp vendor/bin/wire module:install PaymentsIyzico --jsonConfigure an instance in Setup -> Payments -> Gateways by selecting iyzico.
Configuration Schema (SecretBox)
Section titled “Configuration Schema (SecretBox)”| 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. |
Capabilities & Key Components
Section titled “Capabilities & Key Components”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/cancelvoids.IyzicoBasketBuilder::assertParity()guaranteessum(basketItems[].price_minor) === paidPrice_minorusingCurrency’s largest-remainderMoney::allocate(). - BIN Installments (
queryInstallments()): Queries 6+ digit card BIN installment matrices returning typedInstallmentOptionarrays. - Subscriptions & Card Update Portal: Supports
/v2/subscription/initialize, Checkout Form subscription initialization,/upgradeplan switching,/activate,/cancel,getSubscriptionDetails(), and native card-update Checkout Forms viacustomerPortalUrl()(while$payments->customerPortalUrlForUser()serves the signed local/_payments/portal/{token}hub). Note that upstream iyzico does not support pausing subscriptions (pauseSubscription()throwsWireException). - Marketplace Sub-Merchants: Onboards sub-merchants via
POST /onboarding/submerchant(subMerchantKey), mapsPaymentIntentRequest::$splitstobasketItems[].subMerchantKey/subMerchantPrice, and approves payouts viaPOST /payment/iyzipos/item/approve.
Webhook Verification (X-IYZ-SIGNATURE-V3)
Section titled “Webhook Verification (X-IYZ-SIGNATURE-V3)”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.