PardakhtPHP1.0 · Beta

Different gateways.
One payment flow.

Connect Iranian payment gateways through a consistent PHP API. Keep amounts explicit, handle redirects, and verify payments with the gateway you choose.

Your application
Pardakhtpurchase → verify
ZarinpalMellat+12 adapters
composer require eram/pardakht:^1.0@beta

FOLLOW THE PAYMENT

Same order. Two routes.

Recorded PHP examples
Sample order #1042
PAYMENT ATTEMPT#1042
50,000Toman
GatewayZarinpal
Sent to gateway500,000 Rial
Reference receivedDEMO-AUTHORITY
purchase()Illustrative order and gateway response
Zarinpal / Request

A payment attempt begins.

Start with an amount and an order ID. Save the returned reference with the order and gateway in your database.

PHPFlow excerpt
use Eram\Abzar\Money\Amount;
use Eram\Pardakht\Http\PurchaseRequest;

$response = $gateway->purchase(new PurchaseRequest(
    amount: Amount::fromToman(50_000),
    callbackUrl: 'https://example.com/payment/callback',
    orderId: '1042',
    description: 'Demo order',
));

// Save the reference with your payment attempt.
$response->getReferenceId();
What changes in the gateway setup?

The methods are shared; credentials and callback fields belong to each gateway. Configure your gateway first, then follow the stages above. Keep credentials on the server.

use Eram\Pardakht\Pardakht;
use Eram\Pardakht\Gateway\Zarinpal\ZarinpalConfig;
use Eram\Pardakht\Gateway\Mellat\MellatConfig;

$pardakht = new Pardakht();

// Choose a gateway with your own credentials.
$gateway = $pardakht->create('zarinpal',
    new ZarinpalConfig(merchantId: $merchantId)
);

// Or use your Mellat terminal.
$gateway = $pardakht->create('mellat',
    new MellatConfig(
        terminalId: $terminalId,
        username: $username,
        password: $password,
    )
);

Recorded with Pardakht 1.0.0-beta.4 and simulated gateway responses. These controls reveal saved examples; they do not run PHP, contact a bank, or make a payment.

THE UNIT IS PART OF THE VALUE

Toman in your app.
Rial when the gateway needs it.

Create Amount with the unit you mean. It stores an integer Rial value; each adapter reads the unit its gateway expects. Arithmetic returns a new amount.

Working with amounts
Your amount50,000 TomanAmount::fromToman(50_000)
The same value in Rials500,000 Rial$amount->inRials()

GATEWAY CATALOG

Choose your connection.

14 adapters in this release

Adapter availability reflects this library release. Merchant approval, credentials, and gateway-specific requirements still apply. Jibit and Paystar link to source because this release has no dedicated guides for them.

FITS INTO YOUR APPLICATION

Shared plumbing.
Your order logic.

Use plain PHP or the framework you already work with. Pardakht handles the gateway calls; your app owns the order and its lifecycle.

Start with one gateway.

Install the beta, configure your credentials, and follow the guide for your provider. Test the integration before accepting real payments.

Runtime
PHP 8.1+
PHP extensions
curl · json · openssl · soap
Composer dependency
eram/abzar
License
MIT