MerchantGateway   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMerchant() 0 7 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
use PayBreak\Sdk\Entities\MerchantEntity;
14
use PayBreak\Sdk\SdkException;
15
16
/**
17
 * Class MerchantGateway
18
 *
19
 * @author WN
20
 * @package PayBreak\Sdk\Gateways
21
 */
22
class MerchantGateway extends AbstractGateway
23
{
24
    /**
25
     * @param $id
26
     * @param $token
27
     * @return MerchantEntity
28
     * @throws SdkException
29
     */
30 3
    public function getMerchant($id, $token)
31
    {
32 3
        $merchant = MerchantEntity::make($this->fetchDocument('/v4/merchant', $token, 'Merchant'));
33
34 1
        $merchant->setAddress(json_encode($merchant->getAddress()));
35
36 1
        return $merchant->setId($id);
37
    }
38
}
39