Passed
Push — master ( 35d8b0...71e3ff )
by Carlos
07:40
created

GeneralCardClient::deactivate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 9
ccs 0
cts 8
cp 0
crap 2
rs 9.6666
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(array $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 deactivate(string $cardId, string $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