Skip to content

Commit

Permalink
fixed Toman problem with old Zarinpal Soap API
Browse files Browse the repository at this point in the history
  • Loading branch information
samuraee committed May 1, 2022
1 parent 3ad5127 commit 10860e6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Adapter/Zarinpal.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function requestToken ()

$sendParams = [
'MerchantID' => $this->merchant_id,
'Amount' => intval($this->amount),
'Amount' => $this->getToman(),
'Description' => $this->description ? $this->description : '',
'Email' => $this->email ? $this->email : '',
'Mobile' => $this->mobile ? $this->mobile : '',
Expand Down Expand Up @@ -113,7 +113,7 @@ protected function verifyTransaction ()
$sendParams = [
'MerchantID' => $this->merchant_id,
'Authority' => $this->Authority,
'Amount' => intval($this->amount),
'Amount' => $this->getToman(),
];

try {
Expand Down Expand Up @@ -163,4 +163,9 @@ public function getGatewayReferenceId()
]);
return $this->Authority;
}

private function getToman()
{
return (int) ($this->amount / 10);
}
}

0 comments on commit 10860e6

Please sign in to comment.