Passed
Push — master ( 6f4e70...35d8b0 )
by Carlos
02:56
created

GeneralCardClient   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 44
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A activate() 0 4 1
A unactivate() 0 9 1
A updateUser() 0 4 1
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\OfficialAccount\Card;
13
14
/**
15
 * Class GeneralCardClient.
16
 *
17
 * @author overtrue <[email protected]>
18
 */
19
class GeneralCardClient extends Client
20
{
21
    /**
22
     * 通用卡接口激活.
23
     *
24
     * @param array $info
25
     *
26
     * @return mixed
27
     */
28
    public function activate($info = [])
29
    {
30
        return $this->httpPostJson('card/generalcard/activate', $info);
31
    }
32
33
    /**
34
     * 通用卡撤销激活.
35
     *
36
     * @param string $cardId
37
     * @param string $code
38
     *
39
     * @return mixed
40
     */
41
    public function unactivate($cardId, $code)
42
    {
43
        $params = [
44
            'card_id' => $cardId,
45
            'code' => $code,
46
        ];
47
48
        return $this->httpPostJson('card/generalcard/unactivate', $params);
49
    }
50
51
    /**
52
     * 更新会员信息.
53
     *
54
     * @param array $params
55
     *
56
     * @return mixed
57
     */
58
    public function updateUser(array $params = [])
59
    {
60
        return $this->httpPostJson('card/generalcard/updateuser', $params);
61
    }
62
}
63