Skip to content

Configuration

Every Parakit setting lives in config/parakit.php, published by parakit:install. This page documents each key, section by section. If a key is not here, it is not a real key — check against the published file.

Most values read from .env, so you rarely edit the config file itself. The defaults below are what ships in the package.

default

KeyEnv varDefaultPurpose
defaultPARAKIT_DEFAULTfibGateway used when Payment::charge() is called without ->driver(). Must match a key under gateways.

webhooks

Controls the auto-registered webhook route and how incoming webhooks are validated.

KeyEnv varDefaultPurpose
route_prefixpayments/webhooksURL prefix for the webhook route. The full path is POST {prefix}/{gateway}.
middleware['api']Middleware applied to the webhook route.
tolerance_seconds300Webhooks whose timestamp is older than this are rejected as replays.
on_amount_mismatchPARAKIT_WEBHOOK_ON_AMOUNT_MISMATCHlogWhat to do when a Paid webhook's amount disagrees with the charged amount.

on_amount_mismatch has two values:

  • log — records a parakit.webhook.amount_mismatch warning and still applies the status transition.
  • reject — refuses the transition. The payment stays unconfirmed until you investigate.

WARNING

reject is the safer choice if your prices are fixed. Use log only if you have a reason to expect legitimate amount differences.

reliability

Retry, idempotency, circuit-breaker, and timeout behaviour. See Reliability for how these interact.

KeyDefaultPurpose
idempotency_ttl86400Seconds a cached charge() response is replayed for the same idempotency key (24h).
retry.max_attempts3Attempts on transient gateway failures.
retry.base_delay_ms200Base delay for exponential backoff with jitter.
circuit_breaker.failure_threshold5Consecutive failures before the circuit opens for that gateway.
circuit_breaker.cooldown_seconds30How long the circuit stays open before a probe request.
timeout_seconds15HTTP timeout per gateway call.

None of these read from .env — edit config/parakit.php to change them.

logging

Controls writes to the payment_logs table.

KeyEnv varDefaultPurpose
enabledtrueToggle writes to payment_logs.
channelPARAKIT_LOG_CHANNELstackLaravel log channel for human-readable lines.
redact_keyssee belowPayload keys redacted before anything is written to the DB.
retention_days90Age after which parakit:logs:prune removes log rows.

The default redact_keys array:

php
['password', 'token', 'secret', 'key', 'card', 'cvv', 'cvc', 'pan', 'msisdn', 'authorization', 'pin', 'mpin']

Any payload key matching one of these word components is redacted. PAN-like numbers are also redacted by a Luhn-gated regex regardless of the key name, and sensitive URL query values such as ?token=... are scrubbed. Add your own keys to the array if a gateway returns secrets under different names.

raw_payloads

Controls raw gateway bodies that Parakit stores in its own database rows and idempotency cache. Runtime PaymentResponse and RefundResponse objects still carry the gateway response returned by the current call.

KeyEnv varDefaultPurpose
storePARAKIT_STORE_RAW_PAYLOADStrueStore gateway raw payloads on payment_transactions, payment_webhook_events, payment_refunds, and idempotency cache entries. When false, Parakit stores an empty array.
redactPARAKIT_REDACT_RAW_PAYLOADStrueRedact stored payloads using logging.redact_keys before persistence.

sweeper

The lost-webhook recovery sweeper, run by parakit:transactions:sweep-pending (scheduled every five minutes when enabled).

KeyDefaultPurpose
enabledtrueToggle the sweeper. When false, the scheduled job is not registered.
older_than_minutes5A pending transaction must be at least this old before it is swept.
max_age_hours24Transactions older than this are no longer polled — treated as dead.

receipts

Defaults for PDF receipt generation. See Receipts for the generation API.

KeyEnv varDefaultPurpose
templatePARAKIT_RECEIPTS_TEMPLATEmodernTemplate when none is passed at runtime: modern, classic, or minimal.
diskPARAKIT_RECEIPTS_DISKlocalFilesystem disk for ReceiptDocument::save().
pathreceiptsDirectory on that disk where saved receipts land.
filename{type}-{reference}.pdfFilename pattern. Tokens: {type}, {reference}, {id}.
localeappLocale the receipt renders in. app uses the current app locale.

receipts.metadata

When you do not pass customer details explicitly, the receipt falls back to these keys on the transaction's metadata.

KeyDefaultPurpose
name_keycustomer_nameMetadata key holding the customer name.
email_keycustomer_emailMetadata key holding the customer email.
phone_keycustomer_phoneMetadata key holding the customer phone.
locale_keylocaleMetadata key holding the receipt locale.

receipts.merchant

The merchant block printed on every receipt.

KeyEnv varDefaultPurpose
namePARAKIT_MERCHANT_NAMEconfig('app.name')Merchant name shown on the receipt.
addressPARAKIT_MERCHANT_ADDRESSnullMerchant address line.
logoPARAKIT_MERCHANT_LOGOnullLogo as an absolute path or data URI.
support_emailPARAKIT_MERCHANT_SUPPORT_EMAILnullSupport email printed for the customer.

receipts.pdf

dompdf rendering options.

KeyDefaultPurpose
papera4Paper size.
orientationportraitPage orientation.
options.defaultFontDejaVu SansDefault font (see note below).
options.isRemoteEnabledfalseWhether dompdf may load remote assets.

DejaVu Sans is required for Arabic / Kurdish

DejaVu Sans is the only bundled dompdf font with Arabic and Kurdish glyph coverage. Changing defaultFont will break ar / ckb receipts unless the replacement font covers those scripts.

gateways

A map of named gateway configs. The array key is the name you pass to ->driver() and the name that appears in the webhook URL. The driver key inside each entry selects the implementation (fib, zaincash, nass, nasswallet, fastpay, qicard).

php
'gateways' => [
    'fib' => [
        'driver'   => 'fib',
        'base_url' => env('FIB_BASE_URL', 'https://fib.stage.fib.iq'),
        // ...credential keys...
    ],
],

Because the name and the driver are separate, you can register several named configs for the same driver — fib_main, fib_branch, each with its own credentials, circuit-breaker state, and webhook route. See Multi-tenant merchants for that pattern.

The bundled config defines all six gateways. Each one has its own set of credential keys and env vars — see the per-gateway page for the full table and where to obtain the values:

  • FIBbase_url, client_id, client_secret, currency, refundable_for, expires_in, category, callback_url.
  • ZainCashbase_url, client_id, client_secret, api_key, scope, service_type, lang, success_url, failure_url.
  • Nass Paybase_url, username, password, token_ttl, transaction_type, callback_url, return_url.
  • Nass Walletbase_url, portal_url, basic_token, username, password, transaction_pin, callback_url.
  • FastPaybase_url, store_id, store_password, refund_secret_key, success_url, cancel_url, callback_url.
  • QiCardbase_url, username, password, terminal_id, locale, public_key, finish_payment_url, notification_url.

TIP

The default base_url for every gateway points at its staging/UAT host. Set the production URL in .env when you go live — for Nass Wallet the path itself differs between environments.

Released under the MIT License.