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

Client::prepends()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 7
cp 0
crap 2
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\Coupon;
13
14
use EasyWeChat\Payment\Kernel\BaseClient;
15
16
/**
17
 * Class Client.
18
 *
19
 * @author tianyong90 <[email protected]>
20
 */
21
class Client extends BaseClient
22
{
23
    /**
24
     * send a cash coupon.
25
     *
26
     * @param array $params
27
     *
28
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
29
     */
30
    public function send(array $params)
31
    {
32
        $params['openid_count'] = 1;
33
34
        return $this->safeRequest('mmpaymkttransfers/send_coupon', $params);
35
    }
36
37
    /**
38
     * query a coupon stock.
39
     *
40
     * @param array $params
41
     *
42
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
43
     */
44
    public function stock(array $params)
45
    {
46
        return $this->request('mmpaymkttransfers/query_coupon_stock', $params);
47
    }
48
49
    /**
50
     * query a info of coupon.
51
     *
52
     * @param array $params
53
     *
54
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
55
     */
56
    public function info(array $params)
57
    {
58
        return $this->request('mmpaymkttransfers/querycouponsinfo', $params);
59
    }
60
}
61