Skip to content

Commit 10860e6

Browse files
committed
fixed Toman problem with old Zarinpal Soap API
1 parent 3ad5127 commit 10860e6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Adapter/Zarinpal.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function requestToken ()
4444

4545
$sendParams = [
4646
'MerchantID' => $this->merchant_id,
47-
'Amount' => intval($this->amount),
47+
'Amount' => $this->getToman(),
4848
'Description' => $this->description ? $this->description : '',
4949
'Email' => $this->email ? $this->email : '',
5050
'Mobile' => $this->mobile ? $this->mobile : '',
@@ -113,7 +113,7 @@ protected function verifyTransaction ()
113113
$sendParams = [
114114
'MerchantID' => $this->merchant_id,
115115
'Authority' => $this->Authority,
116-
'Amount' => intval($this->amount),
116+
'Amount' => $this->getToman(),
117117
];
118118

119119
try {
@@ -163,4 +163,9 @@ public function getGatewayReferenceId()
163163
]);
164164
return $this->Authority;
165165
}
166+
167+
private function getToman()
168+
{
169+
return (int) ($this->amount / 10);
170+
}
166171
}

0 commit comments

Comments
 (0)