Passed
Push — master ( 3796d2...68e180 )
by Evan
04:00
created

CustomerIntelligenceGateway   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 35
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A performLeadScore() 0 7 1
A getCustomerIntelligence() 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 getCustomerIntelligence($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
    /**
39
     * @author GK
40
     * @param string $installation
41
     * @param array $body
42
     * @param string $token
43
     * @return array
44
     * @throws \WNowicki\Generic\Exception
45
     */
46 1
    public function performLeadScore($installation, array $body, $token)
47
    {
48 1
        return $this->postDocument(
49 1
            '/v4/installations/' . $installation . '/lead-score',
50 1
            $body,
51 1
            $token,
52
            'LeadScore'
53 1
        );
54
    }
55
}
56