Total Complexity | 4 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | class DecryptResponse extends Response |
||
18 | { |
||
19 | protected $parametersName = [ |
||
20 | // Mandatory |
||
21 | 'TransactionType', |
||
22 | 'TransactionResult', |
||
23 | 'ShopTransactionID', |
||
24 | 'BankTransactionID', |
||
25 | 'AuthorizationCode', |
||
26 | 'Currency', |
||
27 | 'Amount', |
||
28 | 'ErrorCode', |
||
29 | 'ErrorDescription', |
||
30 | |||
31 | // Optional |
||
32 | 'Country', |
||
33 | 'CustomInfo', |
||
34 | 'Buyer', // contains BuyerName and BuyerEmail |
||
35 | 'TDLevel', |
||
36 | 'AlertCode', |
||
37 | 'AlertDescription', |
||
38 | 'CVVPresent', |
||
39 | 'MaskedPAN', |
||
40 | 'PaymentMethod', |
||
41 | 'TOKEN', |
||
42 | 'ProductType', |
||
43 | 'TokenExpiryMonth', |
||
44 | 'TokenExpiryYear', |
||
45 | 'TransactionKey', |
||
46 | 'VbV', |
||
47 | 'VbVRisp', |
||
48 | 'VbVBuyer', |
||
49 | 'VbVFlag', |
||
50 | 'AVSResultCode', |
||
51 | 'AVSResultDescription', |
||
52 | 'RiskResponseCode', |
||
53 | 'RiskResponseDescription' |
||
54 | ]; |
||
55 | protected $separator = '*P1*'; |
||
56 | |||
57 | /** |
||
58 | * @param \stdClass $soapResponse |
||
59 | * @throws \Exception |
||
60 | */ |
||
61 | public function __construct($soapResponse) |
||
62 | { |
||
63 | $xml = simplexml_load_string($soapResponse->DecryptResult->any); |
||
64 | if (isset($xml->CustomInfo)) { |
||
65 | $xml->CustomInfo = urldecode($xml->CustomInfo); |
||
66 | } |
||
67 | parent::__construct($xml); |
||
|
|||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return array |
||
72 | */ |
||
73 | public function getCustomInfoToArray() |
||
83 | } |
||
84 | } |
||
85 |