Completed
Push — master ( 71ecec...777be0 )
by Carlos
03:08
created

MemberCardClient::getActivationForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
ccs 0
cts 0
cp 0
crap 2
rs 9.4285
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\OfficialAccount\Card;
13
14
/**
15
 * Class MemberCardClient.
16
 *
17
 * @author overtrue <[email protected]>
18
 */
19
class MemberCardClient 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/membercard/activate', $info);
31
    }
32
33
    /**
34
     * 设置开卡字段接口.
35
     *
36
     * @param string $cardId
37
     * @param array  $settings
38
     *
39
     * @return mixed
40
     */
41
    public function setActivationForm(string $cardId, array $settings)
42
    {
43
        $params = array_merge(['card_id' => $cardId], $settings);
44
45
        return $this->httpPostJson('card/membercard/activateuserform/set', $params);
46
    }
47
48
    /**
49
     * 拉取会员信息接口.
50
     *
51
     * @param string $cardId
52
     * @param string $code
53
     *
54
     * @return mixed
55
     */
56
    public function getUser(string $cardId, string $code)
57
    {
58
        $params = [
59
            'card_id' => $cardId,
60
            'code' => $code,
61
        ];
62
63
        return $this->httpPostJson('card/membercard/userinfo/get', $params);
64
    }
65
66
    /**
67
     * 更新会员信息.
68
     *
69
     * @param array $params
70
     *
71
     * @return mixed
72
     */
73
    public function updateUser(array $params = [])
74
    {
75
        return $this->httpPostJson('card/membercard/updateuser', $params);
76
    }
77
78
79
    /**
80
     * 获取用户提交资料.
81
     *
82
     * @param string $activateTicket
83
     *
84
     * @return mixed
85
     */
86
    public function getActivationForm($activateTicket){
87
88
        $params = [
89
            'activate_ticket' => $activateTicket
90
        ];
91
92
        return $this->httpPostJson('card/membercard/activatetempinfo/get', $params);
93
    }
94
}