Skip to content

Commit 2f726f0

Browse files
committed
feat: adds new event service provider in ship provider
1 parent 2b88112 commit 2f726f0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/Provider/AsanPardakhtProvider.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use PhpMonsters\Shaparak\Exceptions\RefundException;
77
use PhpMonsters\Shaparak\Exceptions\RequestTokenException;
88
use PhpMonsters\Shaparak\Exceptions\SettlementException;
9-
use PhpMonsters\Shaparak\Exceptions\VerificationException;
109

1110
/**
1211
* AsanPardakhtProvider class
@@ -196,10 +195,9 @@ public function sendParamToAp(array $params, string $url, string $method): mixed
196195
);
197196
}
198197

198+
199199
/**
200-
* @return bool
201-
* @throws Exception
202-
* @throws VerificationException
200+
* @inheritDoc
203201
*/
204202
public function verifyTransaction(): bool
205203
{
@@ -213,18 +211,15 @@ public function verifyTransaction(): bool
213211
$response = $this->generateComplementaryOperation(self::URL_VERIFY);
214212

215213
if ($response !== true) {
216-
throw new Exception('shaparak::asanpardakht.could_not_verify_transaction');
214+
return false;
217215
}
218216
$this->getTransaction()->setVerified(true);
219217

220218
return true;
221219
} catch (\Exception $e) {
222-
$this->log($e->getMessage(), [], 'error');
220+
$this->log('verifyTransaction: '.$e->getMessage().' #'.$e->getCode(), [], 'error');
223221

224-
throw new VerificationException(
225-
'verifyTransaction: '.$e->getMessage().' #'.$e->getCode(),
226-
$e->getCode()
227-
);
222+
return false;
228223
}
229224
}
230225

0 commit comments

Comments
 (0)