Completed
Push — master ( 68e180...6c8c67 )
by Gergely
04:44
created

CustomerIntelligenceGateway   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 19
dl 0
loc 70
ccs 21
cts 21
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A performLeadScore() 0 7 1
A listPreApprovals() 0 6 1
A performPreApproval() 0 7 1
A listLeadScores() 0 6 1
1
<?php
2
/*
3
* This file is part of the PayBreak/paybreak-sdk-php package.
4
*
5
* (c) PayBreak <[email protected]>
6
*
7
* For the full copyright and license information, please view the LICENSE
8
* file that was distributed with this source code.
9
*/
10
11
namespace PayBreak\Sdk\Gateways;
12
13
/**
14
 * Customer Intelligence Gateway
15
 *
16
 * @author GK
17
 */
18
class CustomerIntelligenceGateway extends AbstractGateway
19
{
20
    /**
21
     * @author GK
22
     * @param string $installation
23
     * @param string $token
24
     * @param int $offset
25
     * @param int $limit
26
     * @return array
27
     * @throws \WNowicki\Generic\Exception
28
     */
29 1
    public function listLeadScores($installation, $token, $offset = 0, $limit = 20)
30
    {
31 1
        return $this->fetchDocument(
32 1
            '/v4/installations/' . $installation . '/lead-score?offset=' . $offset . '&limit=' . $limit,
33 1
            $token,
34
            'LeadScore'
35 1
        );
36
    }
37
    /**
38
     * @author GK
39
     * @param string $installation
40
     * @param string $token
41
     * @param int $offset
42
     * @param int $limit
43
     * @return array
44
     * @throws \WNowicki\Generic\Exception
45
     */
46 1
    public function listPreApprovals($installation, $token, $offset = 0, $limit = 20)
47
    {
48 1
        return $this->fetchDocument(
49 1
            '/v4/installations/' . $installation . '/pre-approval?offset=' . $offset . '&limit=' . $limit,
50 1
            $token,
51
            'PreApproval'
52 1
        );
53
    }
54
55
    /**
56
     * @author GK
57
     * @param string $installation
58
     * @param array $body
59
     * @param string $token
60
     * @return array
61
     * @throws \WNowicki\Generic\Exception
62
     */
63 1
    public function performLeadScore($installation, array $body, $token)
64
    {
65 1
        return $this->postDocument(
66 1
            '/v4/installations/' . $installation . '/lead-score',
67 1
            $body,
68 1
            $token,
69
            'LeadScore'
70 1
        );
71
    }
72
73
    /**
74
     * @author GK
75
     * @param string $installation
76
     * @param array $body
77
     * @param string $token
78
     * @return array
79
     * @throws \WNowicki\Generic\Exception
80
     */
81 1
    public function performPreApproval($installation, array $body, $token)
82
    {
83 1
        return $this->postDocument(
84 1
            '/v4/installations/' . $installation . '/pre-approval',
85 1
            $body,
86 1
            $token,
87
            'PreApproval'
88 1
        );
89
    }
90
}
91