getMerchantData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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