1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the GestPayWS library. |
||
5 | * |
||
6 | * (c) Manuel Dalla Lana <[email protected]> |
||
7 | * |
||
8 | * This source file is subject to the MIT license that is bundled |
||
9 | * with this source code in the file LICENSE. |
||
10 | */ |
||
11 | |||
12 | namespace EndelWar\GestPayWS\Response; |
||
13 | |||
14 | /** |
||
15 | * Class EncryptResponse |
||
16 | * |
||
17 | * @property string $TransactionType; |
||
18 | * @property string $TransactionResult; |
||
19 | * @property string $CryptDecryptString; |
||
20 | * @property int $ErrorCode; |
||
21 | * @property string $ErrorDescription; |
||
22 | */ |
||
23 | class EncryptResponse extends Response |
||
24 | { |
||
25 | protected $paymentPageUrl = [ |
||
26 | 'test' => 'https://sandbox.gestpay.net/pagam/pagam.aspx', |
||
27 | 'production' => 'https://ecomm.sella.it/pagam/pagam.aspx', |
||
28 | ]; |
||
29 | protected $parametersName = [ |
||
30 | 'TransactionType', |
||
31 | 'TransactionResult', |
||
32 | 'CryptDecryptString', |
||
33 | 'ErrorCode', |
||
34 | 'ErrorDescription', |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * @param \stdClass $soapResponse |
||
39 | * @throws \Exception |
||
40 | */ |
||
41 | public function __construct($soapResponse) |
||
42 | { |
||
43 | $xml = simplexml_load_string($soapResponse->EncryptResult->any); |
||
44 | parent::__construct($xml); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @param string $shopLogin |
||
49 | * @param string $wsdlEnvironment |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getPaymentPageUrl($shopLogin, $wsdlEnvironment) |
||
53 | { |
||
54 | return $this->paymentPageUrl[$wsdlEnvironment] . '?a=' . $shopLogin . '&b=' . $this->CryptDecryptString; |
||
0 ignored issues
–
show
The property
CryptDecryptString does not exist on EndelWar\GestPayWS\Response\EncryptResponse . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
55 | } |
||
56 | } |
||
57 |