Skip to content

Commit

Permalink
Update Saman.php
Browse files Browse the repository at this point in the history
flatten code
  • Loading branch information
imanghafoori1 authored Feb 14, 2018
1 parent 6e74f29 commit 56a44a6
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/Saman/Saman.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,32 +141,32 @@ protected function verifyPayment()

$response = intval($response);

if ($response != $this->amount) {

//Reverse Transaction
if($response>0){
try {
$soap = new SoapClient($this->serverUrl);
$response = $soap->ReverseTransaction($fields["RefNum"], $fields["merchantID"], $fields["password"], $response);

} catch (\SoapFault $e) {
$this->transactionFailed();
$this->newLog('SoapFault', $e->getMessage());
throw $e;
}
}
if ($response == $this->amount) {
$this->transactionSucceed();
return true;
}

//
$this->transactionFailed();
$this->newLog($response, SamanException::$errors[$response]);
throw new SamanException($response);
//Reverse Transaction
if($response>0){
try {
$soap = new SoapClient($this->serverUrl);
$response = $soap->ReverseTransaction($fields["RefNum"], $fields["merchantID"], $fields["password"], $response);

} catch (\SoapFault $e) {
$this->transactionFailed();
$this->newLog('SoapFault', $e->getMessage());
throw $e;
}
}

//
$this->transactionFailed();
$this->newLog($response, SamanException::$errors[$response]);
throw new SamanException($response);


$this->transactionSucceed();

return true;
}


}
}

0 comments on commit 56a44a6

Please sign in to comment.