Properties

$access_token

$access_token : string

访问AccessToken

Type

string

$currentMethod

$currentMethod : array

当前请求方法参数

Type

array

$isTry

$isTry : boolean

当前模式

Type

boolean

$GetAccessTokenCallback

$GetAccessTokenCallback : string

注册代替函数

Type

string

Methods

__construct()

__construct(array  $options) 

BasicWeChat constructor.

Parameters

array $options

getAccessToken()

getAccessToken() : string

获取访问accessToken

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

string

delAccessToken()

delAccessToken() : boolean

清理删除accessToken

Returns

boolean

callPostApi()

callPostApi(string  $url, array  $data, boolean  $isBuildJson = true) : array

接口通用POST请求方法

Parameters

string $url

接口URL

array $data

POST提交接口参数

boolean $isBuildJson

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

callGetApi()

callGetApi(string  $url) : array

接口通用GET请求方法

Parameters

string $url

接口URL

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

getAccountBasicinfo()

getAccountBasicinfo() : array

2.1 获取帐号基本信息

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

setNickname()

setNickname(array  $data) : array

2.2 小程序名称设置及改名

Parameters

array $data

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

queryChangeNicknameAuditStatus()

queryChangeNicknameAuditStatus(integer  $audit_id) : array

2.3 小程序改名审核状态查询

Parameters

integer $audit_id

审核单id

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

checkWxVerifyNickname()

checkWxVerifyNickname(string  $nickname) : array

2.4 微信认证名称检测

Parameters

string $nickname

微信认证名称

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

modifyHeadImage()

modifyHeadImage(string  $headImgMediaId, integer  $x1, integer  $y1, integer  $x2 = 1, integer  $y2 = 1) : array

2.5 修改头像

Parameters

string $headImgMediaId

头像素材media_id

integer $x1

裁剪框左上角x坐标(取值范围:[0, 1])

integer $y1

裁剪框左上角y坐标(取值范围:[0, 1])

integer $x2

裁剪框右下角x坐标(取值范围:[0, 1])

integer $y2

裁剪框右下角y坐标(取值范围:[0, 1])

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

modifySignature()

modifySignature(string  $signature) : array

2.6 修改功能介绍

Parameters

string $signature

功能介绍(简介)

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException]

Returns

array

componentreBindAdmin()

componentreBindAdmin(string  $taskid) : array

2.7.3跳转至第三方平台,第三方平台调用快速注册API完成管理员换绑。

Parameters

string $taskid

换绑管理员任务序列号(公众平台最终点击提交回跳到第三方平台时携带)

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

getAllCategories()

getAllCategories() : array

3.1 获取账号可以设置的所有类目

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

addCategory()

addCategory(array  $categories) : array

3.2 添加类目

Parameters

array $categories

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

delCategroy()

delCategroy(string  $first, string  $second) : array

3.3 删除类目

Parameters

string $first

一级类目ID

string $second

二级类目ID

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

getCategory()

getCategory() : array

3.4 获取账号已经设置的所有类目

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

modifyCategory()

modifyCategory(string  $first, string  $second, array  $certicates) : array

3.5 修改类目

Parameters

string $first

一级类目ID

string $second

二级类目ID

array $certicates

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

array

httpGetForJson()

httpGetForJson(string  $url) : array

以GET获取接口数据并转为数组

Parameters

string $url

接口地址

Throws

\WeChat\Exceptions\InvalidResponseException

Returns

array

httpPostForJson()

httpPostForJson(string  $url, array  $data, boolean  $buildToJson = true) : array

以POST获取接口数据并转为数组

Parameters

string $url

接口地址

array $data

请求数据

boolean $buildToJson

Throws

\WeChat\Exceptions\InvalidResponseException

Returns

array

registerApi()

registerApi(string  $url, string  $method, array  $arguments = array()) : mixed

注册当前请求接口

Parameters

string $url

接口地址

string $method

当前接口方法

array $arguments

请求参数

Throws

\WeChat\Exceptions\InvalidResponseException
\WeChat\Exceptions\LocalCacheException

Returns

mixed