Skip to content

[Bug] Zibal driver ignores optional parameters like mobile, description, etc. #350

@amiriaa1

Description

@amiriaa1

Problem

In the Zibal driver (src/Drivers/Zibal/Zibal.php), the purchase() method builds the POST payload manually and doesn't include optional parameters like:

  • mobile
  • description
  • allowedCards
  • etc.

Even though the method checkOptionalDetails() exists for this purpose, it is never used.

Why it matters

When we set these values using:

$invoice->detail([
    'mobile' => $user->phone,
    'description' => 'Test order'
]);


$data = [
    'merchant'    => $this->settings->merchantId,
    'amount'      => $amount,
    'callbackUrl' => $this->settings->callbackUrl,
    'orderId'     => $orderId
];

$data = $this->checkOptionalDetails($data);

CURLOPT_POSTFIELDS => json_encode($data),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions