Authorization::setEndpoint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace CultureKings\Afterpay\Model\InStore;
3
4
use CultureKings\Afterpay\Contacts\AuthorizationInterface;
5
6
/**
7
 * Class Authorization
8
 * @package CultureKings\Afterpay\Model\InStore
9
 */
10
class Authorization implements AuthorizationInterface
11
{
12
    const PRODUCTION_BASE_URI = 'https://posapi.secure-afterpay.com.au/';
13
    const PRODUCTION_URI = self::PRODUCTION_BASE_URI.'v1/';
14
    const SANDBOX_BASE_URI = 'https://posapi-sandbox.secure-afterpay.com.au/';
15
    const SANDBOX_URI = self::SANDBOX_BASE_URI.'v1/';
16
    const REQUEST_TIMEOUT_SECONDS = 30;
17
18
    /**
19
     * @var string
20
     */
21
    protected $endpoint;
22
23
    /**
24
     * @var string
25
     */
26
    protected $deviceToken;
27
28
    /**
29
     * @var string
30
     */
31
    protected $operator;
32
33
    /**
34
     * @var string
35
     */
36
    protected $userAgent;
37
38
    /**
39
     * Authorization constructor.
40
     * @param null $endpoint
41
     */
42
    public function __construct($endpoint = null)
43
    {
44
        $this->setEndpoint($endpoint);
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getEndpoint()
51
    {
52
        return $this->endpoint;
53
    }
54
55
    /**
56
     * @param string $endpoint
57
     *
58
     * @return $this
59
     */
60
    public function setEndpoint($endpoint)
61
    {
62
        $this->endpoint = $endpoint;
63
64
        return $this;
65
    }
66
67
    /**
68
     * @return string
69
     */
70
    public function getDeviceToken()
71
    {
72
        return $this->deviceToken;
73
    }
74
75
    /**
76
     * @param string $deviceToken
77
     *
78
     * @return Authorization
79
     */
80
    public function setDeviceToken($deviceToken)
81
    {
82
        $this->deviceToken = $deviceToken;
83
84
        return $this;
85
    }
86
87
    /**
88
     * @return string
89
     */
90
    public function getOperator()
91
    {
92
        return $this->operator;
93
    }
94
95
    /**
96
     * @param string $operator
97
     *
98
     * @return Authorization
99
     */
100
    public function setOperator($operator)
101
    {
102
        $this->operator = $operator;
103
104
        return $this;
105
    }
106
107
    /**
108
     * @return string
109
     */
110
    public function getUserAgent()
111
    {
112
        return $this->userAgent;
113
    }
114
115
    /**
116
     * @param string $userAgent
117
     *
118
     * @return Authorization
119
     */
120
    public function setUserAgent($userAgent)
121
    {
122
        $this->userAgent = $userAgent;
123
124
        return $this;
125
    }
126
}
127