Passed
Push — master ( 67a5da...c35f7b )
by Jared
01:13
created

Authorization::setSecret()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace CultureKings\Afterpay\Model\Merchant;
3
4
use CultureKings\Afterpay\Contacts\AuthorizationInterface;
5
6
/**
7
 * Class Authorization
8
 *
9
 * @package CultureKings\Afterpay
10
 */
11
class Authorization implements AuthorizationInterface
12
{
13
    const PRODUCTION_URI = 'https://api.secure-afterpay.com.au/v1/';
14
    const SANDBOX_URI = 'https://api-sandbox.secure-afterpay.com.au/v1/';
15
16
    /**
17
     * @var string
18
     */
19
    protected $endpoint;
20
    /**
21
     * @var string
22
     */
23
    protected $merchantId;
24
    /**
25
     * @var string
26
     */
27
    protected $secret;
28
29
    /**
30
     * Authorization constructor.
31
     * @param string      $endpoint
32
     * @param string|null $merchantId
33
     * @param string|null $secret
34
     */
35
    public function __construct($endpoint, $merchantId = null, $secret = null)
36
    {
37
        $this->setEndpoint($endpoint);
38
        $this->setMerchantId($merchantId);
39
        $this->setSecret($secret);
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getEndpoint()
46
    {
47
        return $this->endpoint;
48
    }
49
50
    /**
51
     * @param string $endpoint
52
     * @return $this
53
     */
54
    public function setEndpoint($endpoint)
55
    {
56
        $this->endpoint = $endpoint;
57
58
        return $this;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getMerchantId()
65
    {
66
        return $this->merchantId;
67
    }
68
69
    /**
70
     * @param string $merchantId
71
     * @return $this
72
     */
73
    public function setMerchantId($merchantId)
74
    {
75
        $this->merchantId = $merchantId;
76
77
        return $this;
78
    }
79
80
    /**
81
     * @return string
82
     */
83
    public function getSecret()
84
    {
85
        return $this->secret;
86
    }
87
88
    /**
89
     * @param string $secret
90
     * @return $this
91
     */
92
    public function setSecret($secret)
93
    {
94
        $this->secret = $secret;
95
96
        return $this;
97
    }
98
}
99