Browse project documentation

IDPay

Pardakhtv1.0.0-beta.4View sourceEnglish / Persian

Popular Iranian payment gateway. REST-based with sandbox support.

Configuration

use Eram\Pardakht\Gateway\IDPay\IDPayConfig;

$config = new IDPayConfig(
    apiKey: 'your-api-key',
    sandbox: false, // Set true for testing
);
ParameterTypeRequiredDefaultDescription
apiKeystringYes—Your IDPay API key
sandboxboolNofalseUse sandbox environment

Purchase

$gateway = $pardakht->create('idpay', $config);

$response = $gateway->purchase(new PurchaseRequest(
    amount: Amount::fromToman(50_000),
    callbackUrl: 'https://example.com/callback',
    orderId: 'ORDER-123',
    description: 'Payment for order',
    mobile: '09123456789',
    email: '[email protected]',
));

header('Location: ' . $response->getUrl());

Verify

$transaction = $gateway->verify();

Sandbox

$config = new IDPayConfig(
    apiKey: 'test',
    sandbox: true,
);

Settlement

Not required. Payments are settled automatically.

Notes

  • REST-based
  • Amount is sent in Rials
  • Supports sandbox mode for testing

Search documentation

Search across all projects. Close this window to return to your guide.

Tab to navigate · Enter to openEsc to close