Completed
Push — master ( 158640...6228b6 )
by Carlos
02:38 queued 01:15
created

Client::info()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 9
loc 9
ccs 0
cts 7
cp 0
crap 2
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyWeChat\Payment\Transfer;
13
14
use EasyWeChat\Payment\Kernel\BaseClient;
15
16
/**
17
 * Class Client.
18
 *
19
 * @author AC <[email protected]>
20
 */
21
class Client extends BaseClient
22
{
23
    /**
24
     * Query MerchantPay.
25
     *
26
     * @param array $params
27
     *
28
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
29
     */
30 View Code Duplication
    public function info(array $params)
31
    {
32
        $base = [
33
            'appid' => $this->app['config']->app_id,
34
            'mch_id' => $this->app['config']->mch_id,
35
        ];
36
37
        return $this->safeRequest('mmpaymkttransfers/gettransferinfo', array_merge($base, $params));
38
    }
39
40
    /**
41
     * Send MerchantPay.
42
     *
43
     * @param array $params
44
     *
45
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
46
     */
47 View Code Duplication
    public function send(array $params)
48
    {
49
        $base = [
50
            'mchid' => $this->app['config']->mch_id,
51
            'mch_appid' => $this->app['config']->app_id,
52
        ];
53
54
        return $this->safeRequest('mmpaymkttransfers/promotion/transfers', array_merge($base, $params));
55
    }
56
}
57