/
Exception.php
38 lines (34 loc) · 1.17 KB
/
Exception.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Alek\PaymentGate\RuRuPay\Client;
use Alek\PaymentGate\RuRuPay\Exception as PackageException;
use Alek\PaymentGate\RuRuPay\Soap\OperationResult;
use Alek\PaymentGate\RuRuPay\Soap\PreInitResult;
use Alek\PaymentGate\RuRuPay\Soap\TransactionStatus;
class Exception extends PackageException
{
/**
* @var OperationResult|PreInitResult
*/
private $result;
/**
* Construct the exception. Note: The message is NOT need.
*
* @param PreInitResult|OperationResult|TransactionStatus $result The Result of Gate Response
* @param \Exception $previous [optional] The previous exception used for the
* exception chaining
*/
public function __construct($result, \Exception $previous = null)
{
$this->result = $result;
$code = $result->ErrorCode;
$message = Exception\Code::getMessage($code);
parent::__construct($message, $code, $previous);
}
/**
* @return OperationResult|PreInitResult
*/
public function getResult()
{
return $this->result;
}
}