AccessControlServerParametersResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 5
c 2
b 0
f 2
lcom 1
cbo 0
dl 0
loc 62
ccs 15
cts 15
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getMerchantData() 0 3 1
A getPaymentAuthorizationRequest() 0 3 1
A getTermsUrl() 0 3 1
A getQuery() 0 3 1
A initializeByObject() 0 8 1
1
<?php
2
/*
3
 * Copyright 2015 Alexey Maslov <[email protected]>
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
namespace alxmsl\PaymentNinja\Response;
19
20
use alxmsl\PaymentNinja\ObjectInitializedInterface;
21
use stdClass;
22
23
/**
24
 * ACS parameters data class
25
 * @author alxmsl
26
 */
27
final class AccessControlServerParametersResponse implements ObjectInitializedInterface {
28
    /**
29
     * @var string merchant data
30
     */
31
    private $merchantData = '';
32
33
    /**
34
     * @var string payment authorization request
35
     */
36
    private $paymentAuthorizationRequest = '';
37
38
    /**
39
     * @var string terms URL
40
     */
41
    private $termsUrl = '';
42
43
    /**
44
     * @var string ACS parameters query
45
     */
46
    private $query = '';
47
48
    /**
49
     * @return string merchant data
50
     */
51 1
    public function getMerchantData() {
52 1
        return $this->merchantData;
53
    }
54
55
    /**
56
     * @return string payment authorization request
57
     */
58 1
    public function getPaymentAuthorizationRequest() {
59 1
        return $this->paymentAuthorizationRequest;
60
    }
61
62
    /**
63
     * @return string terms URL
64
     */
65 1
    public function getTermsUrl() {
66 1
        return $this->termsUrl;
67
    }
68
69
    /**
70
     * @return string ACS parameters query
71
     */
72 1
    public function getQuery() {
73 1
        return $this->query;
74
    }
75
76
    /**
77
     * @inheritdoc
78
     * @return $this initialized object
79
     */
80 1
    public static function initializeByObject(stdClass $Object) {
81 1
        $Response = new AccessControlServerParametersResponse();
82 1
        $Response->merchantData                = (string) $Object->MD;
83 1
        $Response->paymentAuthorizationRequest = (string) $Object->PaReq;
84 1
        $Response->query                       = http_build_query($Object);
85 1
        $Response->termsUrl                    = (string) $Object->TermUrl;
86 1
        return $Response;
87
    }
88
}
89