Completed
Pull Request — develop (#39)
by Gergely
12:07 queued 10:03
created

MerchantGateway::getMerchant()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.008

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 5
cp 0.8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1.008
1
<?php
2
/*
3
 * This file is part of the PayBreak/basket 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