EncryptResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 2
Metric Value
wmc 2
c 4
b 0
f 2
lcom 1
cbo 1
dl 0
loc 34
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPaymentPageUrl() 0 4 1
A __construct() 0 5 1
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
 * @package EndelWar\GestPayWS\Response
17
 *
18
 * @property string $TransactionType;
19
 * @property string $TransactionResult;
20
 * @property string $CryptDecryptString;
21
 * @property int $ErrorCode;
22
 * @property string $ErrorDescription;
23
 */
24
class EncryptResponse extends Response
25
{
26
    protected $paymentPageUrl = array(
27
        'test' => 'https://testecomm.sella.it/pagam/pagam.aspx',
28
        'production' => 'https://ecomm.sella.it/pagam/pagam.aspx',
29
    );
30
    protected $parametersName = array(
31
        'TransactionType',
32
        'TransactionResult',
33
        'CryptDecryptString',
34
        'ErrorCode',
35
        'ErrorDescription',
36
    );
37
38
    /**
39
     * @param \stdClass $soapResponse
40
     * @throws \Exception
41
     */
42 6
    public function __construct($soapResponse)
43
    {
44 6
        $xml = simplexml_load_string($soapResponse->EncryptResult->any);
45 6
        parent::__construct($xml);
46 6
    }
47
48
    /**
49
     * @param string $shopLogin
50
     * @param string $wsdlEnvironment
51
     * @return string
52
     */
53 1
    public function getPaymentPageUrl($shopLogin, $wsdlEnvironment)
54
    {
55 1
        return $this->paymentPageUrl[$wsdlEnvironment] . '?a=' . $shopLogin . '&b=' . $this->CryptDecryptString;
0 ignored issues
show
Bug introduced by
The property CryptDecryptString does not seem to exist. Did you mean CryptDecryptString;?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
56
    }
57
}
58