Skip to content

Introduction

Parakit is a Laravel-native payment kit for Iraq and Kurdistan. It puts the local gateways — FIB, ZainCash, Nass Pay, Nass Wallet, FastPay, and QiCard — behind one fluent API, so charging a customer looks the same no matter which gateway you pick.

If you have used Laravel before, Parakit will feel familiar: a facade, a fluent builder, config in config/parakit.php, events you can listen for. The goal is a first sandbox charge in about 15 minutes — composer require, parakit:install, add credentials, run parakit:transactions:test-charge.

php
use Froshly\Parakit\Facades\Payment;
use Froshly\Parakit\Enums\Currency;

$response = Payment::for($order)
    ->driver('fib')
    ->amount(5000, Currency::IQD)
    ->description("Order #{$order->id}")
    ->idempotencyKey($order->id)
    ->charge();

That returns a PaymentResponse — a redirect URL, or a QR code and deep link, depending on the gateway. The rest of the docs build on this one call.

The six gateways

GatewayDriver keyFlowRefundsCancel
First Iraqi BankfibQR code + readable code + deep linkYesYes
ZainCashzaincashHosted redirectYesNo
Nass PaynassHosted redirectNoNo
Nass WalletnasswalletHosted redirectNoNo
FastPayfastpayHosted redirectYesNo
QiCardqicardHosted card form (3DS)YesYes

The driver key is what you pass to ->driver() and what appears in the webhook URL (POST /payments/webhooks/{gateway}). FIB, ZainCash, FastPay, and QiCard support refunds; Nass Pay and Nass Wallet do not — calling refund() on those throws. FIB and QiCard additionally support cancel() for an unpaid payment.

TIP

You only configure the gateways you use. Most apps start with one.

What you get for free

Taking a payment is the easy part. The parts that bite in production are handled for you:

  • Idempotent webhooks — a unique DB index on (gateway, event_id) makes duplicate gateway deliveries race-safe.
  • Retries — exponential backoff with jitter on transient gateway failures, never on 4xx and never without an idempotency key.
  • Circuit breaker — per-gateway, fails fast after repeated failures and recovers automatically after a cooldown.
  • Redacted logging — requests and responses are written to payment_logs with secrets stripped by key name and a Luhn-gated PAN regex.
  • Lost-webhook sweeperparakit:transactions:sweep-pending polls stale pending transactions so a dropped webhook does not strand an order.
  • PDF receipts — turn any stored transaction into a branded payment or refund PDF, no gateway call involved.
  • Localised UIs — payment screens and receipts ship in English, Arabic, and Sorani Kurdish (en / ar / ckb), RTL-aware.

Where to go next

Released under the MIT License.