Browse project documentation

Mellat (Behpardakht)

Pardakhtv1.0.0-beta.4View sourceEnglish / Persian

Bank Mellat’s payment gateway. SOAP-based with mandatory settlement step.

Configuration

use Eram\Pardakht\Gateway\Mellat\MellatConfig;

$config = new MellatConfig(
    terminalId: 123456,
    username: 'your-username',
    password: 'your-password',
);
ParameterTypeRequiredDescription
terminalIdintYesTerminal ID from Behpardakht
usernamestringYesWeb service username
passwordstringYesWeb service password

Purchase

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

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

// POST form — must use auto-submit
echo $response->renderAutoSubmitForm();

Verify

$transaction = $gateway->verify();

Settlement (Required)

Mellat requires settlement after verification. If you skip this step, the payment will be automatically reversed after approximately 15-30 minutes.

use Eram\Pardakht\Contracts\SupportsSettlement;

if ($gateway instanceof SupportsSettlement) {
    $transaction = $gateway->settle($transaction);
}

Notes

  • SOAP-based — requires ext-soap
  • Uses POST form redirect (not GET)
  • Settlement is mandatory — skipping it reverses the payment
  • Amount is sent in Rials

Search documentation

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

Tab to navigate · Enter to openEsc to close