Completed
Push — master ( 40007f...17133d )
by wannanbigpig
03:34 queued 10s
created

Client   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 185
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
eloc 43
c 1
b 0
f 0
dl 0
loc 185
ccs 45
cts 45
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A faceAuthenticationResultsQuery() 0 12 1
A deleteSafeDomain() 0 9 1
A getUsageTemplateList() 0 16 2
A contentRiskDetect() 0 9 1
A createSafeDomain() 0 9 1
A updateBaseInfo() 0 5 1
A getCategoryList() 0 7 1
A getBaseInfo() 0 7 1
1
<?php
2
/*
3
 * This file is part of the wannanbigpig/alipay-sdk-php.
4
 *
5
 * (c) wannanbigpig <[email protected]>
6
 *
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace EasyAlipay\MiniProgram\Base;
12
13
use EasyAlipay\Kernel\Support\Support;
14
15
class Client extends Support
16
{
17
    /**
18
     * alipay.open.mini.baseinfo.query(查询小程序基础信息).
19
     *
20
     * @return array|object|\Psr\Http\Message\ResponseInterface|\WannanBigPig\Supports\Collection|\WannanBigPig\Supports\Http\Response
21
     *
22
     * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
23
     * @throws \GuzzleHttp\Exception\GuzzleException
24
     * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException
25
     */
26 2
    public function getBaseInfo()
27
    {
28 2
        $method = 'alipay.open.mini.baseinfo.query';
29 2
        $params = [];
30
31 2
        return $this->request($method, [
32 2
            'biz_content' => $params,
33
        ]);
34
    }
35
36
    /**
37
     * alipay.open.mini.baseinfo.modify(小程序修改基础信息).
38
     *
39
     * @param array $params
40
     *
41
     * @return array|object|\Psr\Http\Message\ResponseInterface|\WannanBigPig\Supports\Collection|\WannanBigPig\Supports\Http\Response
42
     *
43
     * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
44
     * @throws \GuzzleHttp\Exception\GuzzleException
45
     * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException
46
     */
47 2
    public function updateBaseInfo(array $params)
48
    {
49 2
        $method = 'alipay.open.mini.baseinfo.modify';
50
51 2
        return $this->request($method, $params);
52
    }
53
54
    /**
55
     *  alipay.open.mini.template.usage.query(查询使用模板的小程序列表).
56
     *
57
     * @param string      $templateId
58
     * @param int         $pageNum
59
     * @param int         $pageSize
60
     * @param string|null $templateVersion
61
     *
62
     * @return array|object|\Psr\Http\Message\ResponseInterface|\WannanBigPig\Supports\Collection|\WannanBigPig\Supports\Http\Response
63
     *
64
     * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
65
     * @throws \GuzzleHttp\Exception\GuzzleException
66
     * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException
67
     */
68 2
    public function getUsageTemplateList(string $templateId, int $pageNum = 1, int $pageSize = 10, string $templateVersion = null)
69
    {
70 2
        $method = 'alipay.open.mini.template.usage.query';
71
72
        $params = [
73 2
            'template_id' => $templateId,
74 2
            'page_num' => $pageNum,
75 2
            'page_size' => $pageSize,
76
        ];
77
78 2
        if ($templateVersion !== null) {
79 2
            $params['template_version'] = $templateVersion;
80
        }
81
82 2
        return $this->request($method, [
83 2
            'biz_content' => $params,
84
        ]);
85
    }
86
87
    /**
88
     * alipay.open.mini.safedomain.create(小程序添加域白名单).
89
     *
90
     * @param string $safeDomain
91
     *
92
     * @return array|object|\Psr\Http\Message\ResponseInterface|\WannanBigPig\Supports\Collection|\WannanBigPig\Supports\Http\Response
93
     *
94
     * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
95
     * @throws \GuzzleHttp\Exception\GuzzleException
96
     * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException
97
     */
98 2
    public function createSafeDomain(string $safeDomain)
99
    {
100 2
        $method = 'alipay.open.mini.safedomain.create';
101
        $params = [
102 2
            'safe_domain' => $safeDomain,
103
        ];
104
105 2
        return $this->request($method, [
106 2
            'biz_content' => $params,
107
        ]);
108
    }
109
110
    /**
111
     * alipay.open.mini.safedomain.delete(小程序删除域白名单).
112
     *
113
     * @param string $safeDomain
114
     *
115
     * @return array|object|\Psr\Http\Message\ResponseInterface|\WannanBigPig\Supports\Collection|\WannanBigPig\Supports\Http\Response
116
     *
117
     * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
118
     * @throws \GuzzleHttp\Exception\GuzzleException
119
     * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException
120
     */
121 2
    public function deleteSafeDomain(string $safeDomain)
122
    {
123 2
        $method = 'alipay.open.mini.safedomain.delete';
124
        $params = [
125 2
            'safe_domain' => $safeDomain,
126
        ];
127
128 2
        return $this->request($method, [
129 2
            'biz_content' => $params,
130
        ]);
131
    }
132
133
    /**
134
     * alipay.security.risk.content.detect(小程序内容风险检测服务).
135
     *
136
     * @param string $content
137
     *
138
     * @return array|object|\Psr\Http\Message\ResponseInterface|\WannanBigPig\Supports\Collection|\WannanBigPig\Supports\Http\Response
139
     *
140
     * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
141
     * @throws \GuzzleHttp\Exception\GuzzleException
142
     * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException
143
     */
144 2
    public function contentRiskDetect(string $content)
145
    {
146 2
        $method = 'alipay.security.risk.content.detect';
147
        $params = [
148 2
            'content' => $content,
149
        ];
150
151 2
        return $this->request($method, [
152 2
            'biz_content' => $params,
153
        ]);
154
    }
155
156
    /**
157
     * alipay.open.mini.category.query(小程序类目树查询).
158
     *
159
     * @return array|object|\Psr\Http\Message\ResponseInterface|\WannanBigPig\Supports\Collection|\WannanBigPig\Supports\Http\Response
160
     *
161
     * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
162
     * @throws \GuzzleHttp\Exception\GuzzleException
163
     * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException
164
     */
165 2
    public function getCategoryList()
166
    {
167 2
        $method = 'alipay.open.mini.category.query';
168 2
        $params = [];
169
170 2
        return $this->request($method, [
171 2
            'biz_content' => $params,
172
        ]);
173
    }
174
175
    /**
176
     * zoloz.identification.customer.certifyzhub.query(刷脸查询认证结果接口).
177
     *
178
     * @param string $bizId
179
     * @param string $zimId
180
     * @param int    $faceType
181
     *
182
     * @return array|object|\Psr\Http\Message\ResponseInterface|\WannanBigPig\Supports\Collection|\WannanBigPig\Supports\Http\Response
183
     *
184
     * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
185
     * @throws \GuzzleHttp\Exception\GuzzleException
186
     * @throws \WannanBigPig\Supports\Exceptions\InvalidArgumentException
187
     */
188 2
    public function faceAuthenticationResultsQuery(string $bizId, string $zimId, int $faceType = 0)
189
    {
190 2
        $method = 'zoloz.identification.customer.certifyzhub.query';
191
        $params = [
192 2
            'biz_id' => $bizId,
193 2
            'zim_id' => $zimId,
194 2
            'face_type' => $faceType,
195 2
            'bizType' => 2,
196
        ];
197
198 2
        return $this->request($method, [
199 2
            'biz_content' => $params,
200
        ]);
201
    }
202
}
203