StripeConfiguration   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Test Coverage

Coverage 84.62%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 64
ccs 11
cts 13
cp 0.8462
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A clientId() 0 3 1
A redirectUrl() 0 3 1
A ourSecretState() 0 3 1
A __construct() 0 5 1
A clientSecret() 0 3 1
1
<?php
2
/**
3
 * @author Tharanga Kothalawala <[email protected]>
4
 * @date   15-02-2021
5
 */
6
7
namespace TSK\SSO\ThirdParty\Stripe;
8
9
/**
10
 * This represents a stripe oauth configuration
11
 *
12
 * @package TSK\SSO\ThirdParty\Stripe
13
 */
14
class StripeConfiguration
15
{
16
    /**
17
     * @var string Stripe Client ID
18
     * @see https://dashboard.stripe.com/settings/applications
19
     */
20
    private $clientId;
21
22
    /**
23
     * @var string Stripe Client Secret
24
     */
25
    private $clientSecret;
26
27
    /**
28
     * @var string Redirection URL back to the client application
29
     */
30
    private $redirectUrl;
31
32
    /**
33
     * StripeConfiguration constructor.
34
     *
35
     * @param string $clientId     Stripe Client ID
36
     * @param string $clientSecret Stripe Client Secret
37
     * @param string $redirectUrl  Redirection URL back to the client application
38
     */
39 2
    public function __construct($clientId, $clientSecret, $redirectUrl)
40
    {
41 2
        $this->clientId = $clientId;
42 2
        $this->clientSecret = $clientSecret;
43 2
        $this->redirectUrl = $redirectUrl;
44 2
    }
45
46
    /**
47
     * @return string
48
     */
49 1
    public function clientId()
50
    {
51 1
        return $this->clientId;
52
    }
53
54
    /**
55
     * @return string
56
     */
57 1
    public function clientSecret()
58
    {
59 1
        return $this->clientSecret;
60
    }
61
62
    /**
63
     * @return string
64
     */
65 1
    public function redirectUrl()
66
    {
67 1
        return $this->redirectUrl;
68
    }
69
70
    /**
71
     * This is just to identify that, we initiated the login sequence (not someone else)
72
     *
73
     * @return string
74
     */
75
    public function ourSecretState()
76
    {
77
        return md5($this->clientId);
78
    }
79
}
80