mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2026-09-04 23:12:09 +08:00
fix: 批量更新代码,同时增加通用接口调用
This commit is contained in:
parent
c901adfb29
commit
955cb28427
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicAliPay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝App支付网关
|
* 支付宝App支付网关
|
||||||
* Class App
|
|
||||||
* @package AliPay
|
* @package AliPay
|
||||||
*/
|
*/
|
||||||
class App extends BasicAliPay
|
class App extends BasicAliPay
|
||||||
@ -38,9 +37,9 @@ class App extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建数据操作
|
* 生成APP支付参数字符串
|
||||||
* @param array $options
|
* @param array $options 订单参数(out_trade_no, total_amount, subject等)
|
||||||
* @return string
|
* @return string URL编码后的参数字符串(用于APP调起支付)
|
||||||
*/
|
*/
|
||||||
public function apply($options)
|
public function apply($options)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicAliPay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝电子面单下载
|
* 支付宝电子面单下载
|
||||||
* Class Bill
|
|
||||||
* @package AliPay
|
* @package AliPay
|
||||||
*/
|
*/
|
||||||
class Bill extends BasicAliPay
|
class Bill extends BasicAliPay
|
||||||
@ -36,9 +35,9 @@ class Bill extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建数据操作
|
* 获取账单下载地址
|
||||||
* @param array $options
|
* @param array $options 账单参数(bill_type, bill_date 等)
|
||||||
* @return array|bool
|
* @return array|bool 包含 bill_download_url
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicAliPay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝刷卡支付
|
* 支付宝刷卡支付
|
||||||
* Class Pos
|
|
||||||
* @package AliPay
|
* @package AliPay
|
||||||
*/
|
*/
|
||||||
class Pos extends BasicAliPay
|
class Pos extends BasicAliPay
|
||||||
@ -37,9 +36,9 @@ class Pos extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建数据操作
|
* 刷卡支付(条码/声波)下单
|
||||||
* @param array $options
|
* @param array $options 订单参数(out_trade_no, auth_code, subject, total_amount 等)
|
||||||
* @return array|bool
|
* @return array|bool 支付结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicAliPay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝扫码支付
|
* 支付宝扫码支付
|
||||||
* Class Scan
|
|
||||||
* @package AliPay
|
* @package AliPay
|
||||||
*/
|
*/
|
||||||
class Scan extends BasicAliPay
|
class Scan extends BasicAliPay
|
||||||
@ -36,9 +35,9 @@ class Scan extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建数据操作
|
* 预创建扫码支付订单(返回二维码地址)
|
||||||
* @param array $options
|
* @param array $options 订单参数(out_trade_no, subject, total_amount 等)
|
||||||
* @return array|bool
|
* @return array|bool 包含 qr_code 的预下单结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,15 +20,14 @@ use WeChat\Contracts\BasicAliPay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝标准接口
|
* 支付宝标准接口
|
||||||
* Class Trade
|
|
||||||
* @package AliPay
|
* @package AliPay
|
||||||
*/
|
*/
|
||||||
class Trade extends BasicAliPay
|
class Trade extends BasicAliPay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置交易接口地址
|
* 设置交易接口方法名
|
||||||
* @param string $method
|
* @param string $method 如 alipay.trade.close 等
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setMethod($method)
|
public function setMethod($method)
|
||||||
@ -38,7 +37,7 @@ class Trade extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取交易接口地址
|
* 获取当前交易接口方法名
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getMethod()
|
public function getMethod()
|
||||||
@ -47,8 +46,8 @@ class Trade extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置接口公共参数
|
* 设置公共参数(透传到 options)
|
||||||
* @param array $option
|
* @param array $option key-value 公共参数
|
||||||
* @return Trade
|
* @return Trade
|
||||||
*/
|
*/
|
||||||
public function setOption($option = [])
|
public function setOption($option = [])
|
||||||
@ -60,7 +59,7 @@ class Trade extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取接口公共参数
|
* 获取当前公共参数
|
||||||
* @return array|string|null
|
* @return array|string|null
|
||||||
*/
|
*/
|
||||||
public function getOption()
|
public function getOption()
|
||||||
@ -69,9 +68,9 @@ class Trade extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行通过接口
|
* 执行当前设置的交易接口
|
||||||
* @param array $options
|
* @param array $options 业务参数(写入 biz_content)
|
||||||
* @return array|boolean
|
* @return array|boolean 接口返回结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,16 +20,15 @@ use WeChat\Contracts\BasicAliPay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝转账到账户
|
* 支付宝转账到账户
|
||||||
* Class Transfer
|
|
||||||
* @package AliPay
|
* @package AliPay
|
||||||
*/
|
*/
|
||||||
class Transfer extends BasicAliPay
|
class Transfer extends BasicAliPay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 旧版 向指定支付宝账户转账
|
* 旧版:向支付宝账户转账(toaccount.transfer)
|
||||||
* @param array $options
|
* @param array $options 转账参数(out_biz_no, payee_type, payee_account, amount, remark 等)
|
||||||
* @return array|bool
|
* @return array|bool 转账结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -40,9 +39,9 @@ class Transfer extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新版 向指定支付宝账户转账
|
* 新版:统一转账接口(uni.transfer)
|
||||||
* @param array $options
|
* @param array $options 转账参数(out_biz_no, trans_amount, product_code, payee_info 等)
|
||||||
* @return array|bool
|
* @return array|bool 转账结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -53,9 +52,9 @@ class Transfer extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新版 转账业务单据查询接口
|
* 新版:转账业务单据查询
|
||||||
* @param array $options
|
* @param array $options 查询参数(out_biz_no 或 order_id)
|
||||||
* @return array|bool
|
* @return array|bool 查询结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -66,9 +65,9 @@ class Transfer extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新版 支付宝资金账户资产查询接口
|
* 新版:资金账户余额查询
|
||||||
* @param array $options
|
* @param array $options 查询参数(alipay_user_id 或 user_id,可选 account_type)
|
||||||
* @return array|bool
|
* @return array|bool 账户余额等信息
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicAliPay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机WAP网站支付支持
|
* 手机WAP网站支付支持
|
||||||
* Class Wap
|
|
||||||
* @package AliPay
|
* @package AliPay
|
||||||
*/
|
*/
|
||||||
class Wap extends BasicAliPay
|
class Wap extends BasicAliPay
|
||||||
@ -37,9 +36,9 @@ class Wap extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建数据操作
|
* 生成 WAP 支付表单 HTML
|
||||||
* @param array $options
|
* @param array $options 订单参数(out_trade_no, total_amount, subject, quit_url, return_url 等)
|
||||||
* @return string
|
* @return string 自动提交的支付表单 HTML
|
||||||
*/
|
*/
|
||||||
public function apply($options)
|
public function apply($options)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicAliPay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝网站支付
|
* 支付宝网站支付
|
||||||
* Class Web
|
|
||||||
* @package AliPay
|
* @package AliPay
|
||||||
*/
|
*/
|
||||||
class Web extends BasicAliPay
|
class Web extends BasicAliPay
|
||||||
@ -37,9 +36,9 @@ class Web extends BasicAliPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建数据操作
|
* 生成网站支付表单HTML
|
||||||
* @param array $options
|
* @param array $options 订单参数(out_trade_no, total_amount, subject等)
|
||||||
* @return string
|
* @return string 支付表单HTML(自动提交到支付宝)
|
||||||
*/
|
*/
|
||||||
public function apply($options)
|
public function apply($options)
|
||||||
{
|
{
|
||||||
|
|||||||
5
We.php
5
We.php
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Exceptions\InvalidInstanceException;
|
|||||||
/**
|
/**
|
||||||
* 加载缓存器
|
* 加载缓存器
|
||||||
*
|
*
|
||||||
* Class We
|
|
||||||
* @library WeChatDeveloper
|
* @library WeChatDeveloper
|
||||||
* @author Anyon<zoujingli@qq.com>
|
* @author Anyon<zoujingli@qq.com>
|
||||||
* @date 2018/05/24 13:23
|
* @date 2018/05/24 13:23
|
||||||
@ -59,7 +58,7 @@ use WeChat\Exceptions\InvalidInstanceException;
|
|||||||
* ----- WeMini -----
|
* ----- WeMini -----
|
||||||
* @method \WeMini\Crypt WeMiniCrypt($options = []) static 小程序数据加密处理
|
* @method \WeMini\Crypt WeMiniCrypt($options = []) static 小程序数据加密处理
|
||||||
* @method \WeMini\Delivery WeMiniDelivery($options = []) static 小程序即时配送
|
* @method \WeMini\Delivery WeMiniDelivery($options = []) static 小程序即时配送
|
||||||
* @method \WeMini\Shipping WeMiniShipping($options = []) satic 小程序发货信息
|
* @method \WeMini\Shipping WeMiniShipping($options = []) static 小程序发货信息
|
||||||
* @method \WeMini\Guide WeMiniGuide($options = []) static 小程序导购助手
|
* @method \WeMini\Guide WeMiniGuide($options = []) static 小程序导购助手
|
||||||
* @method \WeMini\Image WeMiniImage($options = []) static 小程序图像处理
|
* @method \WeMini\Image WeMiniImage($options = []) static 小程序图像处理
|
||||||
* @method \WeMini\Live WeMiniLive($options = []) static 小程序直播接口
|
* @method \WeMini\Live WeMiniLive($options = []) static 小程序直播接口
|
||||||
|
|||||||
221
WeChat/Card.php
221
WeChat/Card.php
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 卡券管理
|
* 卡券管理
|
||||||
* Class Card
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Card extends BasicWeChat
|
class Card extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 创建卡券
|
* 创建卡券
|
||||||
* @param array $data
|
* @param array $data 卡券数据(card 对象)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -39,9 +38,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置买单接口
|
* 设置买单开关
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @param bool $isOpen
|
* @param bool $isOpen 是否开启
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -53,9 +52,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置自助核销接口
|
* 设置自助核销
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @param bool $isOpen
|
* @param bool $isOpen 是否开启
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -67,8 +66,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建二维码接口
|
* 创建卡券二维码
|
||||||
* @param array $data
|
* @param array $data 二维码参数(action_name, card 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -80,8 +79,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建货架接口
|
* 创建卡券货架
|
||||||
* @param array $data
|
* @param array $data 货架参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -93,9 +92,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入自定义code
|
* 导入自定义 code
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @param array $code
|
* @param array $code code 列表(最多10万)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -107,8 +106,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询导入code数目
|
* 查询已导入 code 数量
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -120,9 +119,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 核查code接口
|
* 校验导入的 code
|
||||||
* @param string $cardId 进行导入code的卡券ID
|
* @param string $cardId 卡券ID
|
||||||
* @param array $code 已经微信卡券后台的自定义code,上限为100个
|
* @param array $code 自定义 code 列表(<=100)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -134,8 +133,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图文消息群发卡券
|
* 获取图文群发卡券的 HTML
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -148,8 +147,8 @@ class Card extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置测试白名单
|
* 设置测试白名单
|
||||||
* @param array $openids
|
* @param array $openids 测试 openid 列表
|
||||||
* @param array $usernames
|
* @param array $usernames 测试微信号列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -161,10 +160,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线下核销查询Code
|
* 查询 Code 状态
|
||||||
* @param string $code 单张卡券的唯一标准
|
* @param string $code 卡券 code
|
||||||
* @param string $cardId 卡券ID代表一类卡券。自定义code卡券必填
|
* @param string $cardId 卡券ID(自定义 code 必填)
|
||||||
* @param bool $checkConsume 是否校验code核销状态,填入true和false时的code异常状态返回数据不同
|
* @param bool $checkConsume 是否校验核销状态
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -179,9 +178,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线下核销核销Code
|
* 核销 Code
|
||||||
* @param string $code 需核销的Code码
|
* @param string $code 待核销的 code
|
||||||
* @param null $card_id 券ID。创建卡券时use_custom_code填写true时必填。非自定义Code不必填写
|
* @param null|string $card_id 卡券ID(自定义 code 必填)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -195,8 +194,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Code解码接口
|
* 解码加密 Code
|
||||||
* @param string $encryptCode
|
* @param string $encryptCode 加密 code
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -208,9 +207,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户已领取卡券接口
|
* 获取用户已领取卡券
|
||||||
* @param string $openid
|
* @param string $openid 用户 openid
|
||||||
* @param null|string $cardId
|
* @param null|string $cardId 卡券ID(可选)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -225,7 +224,7 @@ class Card extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看卡券详情
|
* 查看卡券详情
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -237,10 +236,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量查询卡券列表
|
* 批量查询卡券
|
||||||
* @param int $offset 查询卡列表的起始偏移量,从0开始,即offset: 5是指从从列表里的第六个开始读取
|
* @param int $offset 起始偏移量
|
||||||
* @param int $count 需要查询的卡片的数量(数量最大50)
|
* @param int $count 拉取数量(<=50)
|
||||||
* @param array $statusList 支持开发者拉出指定状态的卡券列表
|
* @param array $statusList 状态过滤
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -254,9 +253,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更改卡券信息接口
|
* 更新会员卡信息
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @param array $memberCard
|
* @param array $memberCard 会员卡内容
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -268,10 +267,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改库存接口
|
* 修改库存
|
||||||
* @param string $card_id 卡券ID
|
* @param string $card_id 卡券ID
|
||||||
* @param null|integer $increase_stock_value 增加多少库存,支持不填或填0
|
* @param int|null $increase_stock_value 增加库存
|
||||||
* @param null|integer $reduce_stock_value 减少多少库存,可以不填或填0
|
* @param int|null $reduce_stock_value 减少库存
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -286,9 +285,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更改Code接口
|
* 变更 Code
|
||||||
* @param string $code 需变更的Code码
|
* @param string $code 原 code
|
||||||
* @param string $new_code 变更后的有效Code码
|
* @param string $new_code 新 code
|
||||||
* @param null|string $card_id 卡券ID
|
* @param null|string $card_id 卡券ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
@ -303,8 +302,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除卡券接口
|
* 删除卡券
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -316,10 +315,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置卡券失效接口
|
* 设置卡券失效
|
||||||
* @param string $code
|
* @param string $code 卡券 code
|
||||||
* @param string $cardId
|
* @param string $cardId 卡券ID
|
||||||
* @param null|string $reason
|
* @param null|string $reason 失效原因
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -333,10 +332,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取卡券概况数据接口
|
* 拉取卡券概况数据
|
||||||
* @param string $beginDate 查询数据的起始时间
|
* @param string $beginDate 开始日期
|
||||||
* @param string $endDate 查询数据的截至时间
|
* @param string $endDate 结束日期
|
||||||
* @param string $condSource 卡券来源(0为公众平台创建的卡券数据 1是API创建的卡券数据)
|
* @param string $condSource 卡券来源 0|1
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -349,11 +348,11 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取免费券数据接口
|
* 获取免费券数据
|
||||||
* @param string $beginDate 查询数据的起始时间
|
* @param string $beginDate 开始日期
|
||||||
* @param string $endDate 查询数据的截至时间
|
* @param string $endDate 结束日期
|
||||||
* @param integer $condSource 卡券来源,0为公众平台创建的卡券数据、1是API创建的卡券数据
|
* @param int $condSource 卡券来源 0|1
|
||||||
* @param null $cardId 卡券ID
|
* @param null|string $cardId 卡券ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -369,7 +368,7 @@ class Card extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 激活会员卡
|
* 激活会员卡
|
||||||
* @param array $data
|
* @param array $data 激活参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -381,9 +380,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置开卡字段接口
|
* 设置开卡字段(激活表单)
|
||||||
* 用户激活时需要填写的选项
|
* @param array $data 表单字段
|
||||||
* @param array $data
|
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -395,9 +393,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户提交资料
|
* 获取用户提交的激活资料
|
||||||
* 根据activate_ticket获取到用户填写的信息
|
* @param string $activateTicket 激活 ticket
|
||||||
* @param string $activateTicket
|
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -410,7 +407,7 @@ class Card extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新会员信息
|
* 更新会员信息
|
||||||
* @param array $data
|
* @param array $data 更新参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -422,10 +419,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取会员卡概况数据接口
|
* 拉取会员卡概况数据
|
||||||
* @param string $beginDate 查询数据的起始时间
|
* @param string $beginDate 开始日期
|
||||||
* @param string $endDate 查询数据的截至时间
|
* @param string $endDate 结束日期
|
||||||
* @param string $condSource 卡券来源(0为公众平台创建的卡券数据 1是API创建的卡券数据)
|
* @param string $condSource 卡券来源 0|1
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -438,10 +435,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取单张会员卡数据接口
|
* 拉取单张会员卡数据
|
||||||
* @param string $beginDate 查询数据的起始时间
|
* @param string $beginDate 开始日期
|
||||||
* @param string $endDate 查询数据的截至时间
|
* @param string $endDate 结束日期
|
||||||
* @param string $cardId 卡券id
|
* @param string $cardId 卡券ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -454,9 +451,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取会员信息(积分查询)接口
|
* 查询会员信息(积分)
|
||||||
* @param string $cardId 查询会员卡的cardid
|
* @param string $cardId 会员卡ID
|
||||||
* @param string $code 所查询用户领取到的code值
|
* @param string $code 用户 code
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -469,8 +466,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置支付后投放卡券接口
|
* 支付后投放卡券规则
|
||||||
* @param array $data
|
* @param array $data 规则参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -483,7 +480,7 @@ class Card extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除支付后投放卡券规则
|
* 删除支付后投放卡券规则
|
||||||
* @param integer $ruleId 支付即会员的规则名称
|
* @param int $ruleId 规则ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -495,8 +492,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询支付后投放卡券规则详情
|
* 查询支付后投放卡券规则
|
||||||
* @param integer $ruleId 要查询规则id
|
* @param int $ruleId 规则ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -508,10 +505,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量查询支付后投放卡券规则
|
* 批量查询支付后投放规则
|
||||||
* @param integer $offset 起始偏移量
|
* @param int $offset 起始偏移
|
||||||
* @param integer $count 查询的数量
|
* @param int $count 数量
|
||||||
* @param bool $effective 是否仅查询生效的规则
|
* @param bool $effective 是否仅查询生效规则
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -524,8 +521,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建支付后领取立减金活动
|
* 创建支付后立减金活动
|
||||||
* @param array $data
|
* @param array $data 活动参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -537,7 +534,7 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开通券点账户接口
|
* 开通券点账户
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -549,9 +546,9 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对优惠券批价
|
* 预估优惠券库存价格
|
||||||
* @param string $cardId 需要来配置库存的card_id
|
* @param string $cardId 卡券ID
|
||||||
* @param integer $quantity 本次需要兑换的库存数目
|
* @param int $quantity 兑换数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -563,7 +560,7 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询券点余额接口
|
* 查询券点余额
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -575,10 +572,10 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认兑换库存接口
|
* 确认兑换库存
|
||||||
* @param string $cardId 需要来兑换库存的card_id
|
* @param string $cardId 卡券ID
|
||||||
* @param integer $quantity 本次需要兑换的库存数目
|
* @param int $quantity 数量
|
||||||
* @param string $orderId 仅可以使用上面得到的订单号,保证批价有效性
|
* @param string $orderId 批价返回的订单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -591,8 +588,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值券点接口
|
* 充值券点
|
||||||
* @param integer $coinCount
|
* @param int $coinCount 充值数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -604,8 +601,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单详情接口
|
* 查询券点订单详情
|
||||||
* @param string $orderId
|
* @param string $orderId 订单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -617,8 +614,8 @@ class Card extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询券点流水详情接口
|
* 查询券点流水
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -631,7 +628,7 @@ class Card extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取开卡插件参数
|
* 获取开卡插件参数
|
||||||
* @param array $data
|
* @param array $data 入口参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -21,36 +21,31 @@ use WeChat\Exceptions\InvalidResponseException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝支付基类
|
* 支付宝支付基类
|
||||||
* Class AliPay
|
* @package WeChat\Contracts
|
||||||
* @package AliPay\Contracts
|
|
||||||
*/
|
*/
|
||||||
abstract class BasicAliPay
|
abstract class BasicAliPay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* 支持配置
|
|
||||||
* @var DataArray
|
|
||||||
*/
|
|
||||||
protected $config;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前请求数据
|
|
||||||
* @var DataArray
|
|
||||||
*/
|
|
||||||
protected $options;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DzContent数据
|
|
||||||
* @var DataArray
|
|
||||||
*/
|
|
||||||
protected $params;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 静态缓存
|
* 静态缓存
|
||||||
* @var static
|
* @var static
|
||||||
*/
|
*/
|
||||||
protected static $cache;
|
protected static $cache;
|
||||||
|
/**
|
||||||
|
* 支持配置
|
||||||
|
* @var DataArray
|
||||||
|
*/
|
||||||
|
protected $config;
|
||||||
|
/**
|
||||||
|
* 当前请求数据
|
||||||
|
* @var DataArray
|
||||||
|
*/
|
||||||
|
protected $options;
|
||||||
|
/**
|
||||||
|
* DzContent数据
|
||||||
|
* @var DataArray
|
||||||
|
*/
|
||||||
|
protected $params;
|
||||||
/**
|
/**
|
||||||
* 正常请求网关
|
* 正常请求网关
|
||||||
* @var string
|
* @var string
|
||||||
@ -137,6 +132,188 @@ abstract class BasicAliPay
|
|||||||
return $this->getResult(['out_trade_no' => $outTradeNo]);
|
return $this->getResult(['out_trade_no' => $outTradeNo]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求接口并验证访问数据
|
||||||
|
* @param array $options
|
||||||
|
* @return array|boolean
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
protected function getResult($options)
|
||||||
|
{
|
||||||
|
$this->applyData($options);
|
||||||
|
$method = str_replace('.', '_', $this->options['method']) . '_response';
|
||||||
|
$data = json_decode(Tools::get($this->gateway, $this->options->get()), true);
|
||||||
|
if (!isset($data[$method]['code']) || $data[$method]['code'] !== '10000') {
|
||||||
|
throw new InvalidResponseException(
|
||||||
|
"Error: " .
|
||||||
|
(empty($data[$method]['code']) ? '' : "{$data[$method]['msg']} [{$data[$method]['code']}]\r\n") .
|
||||||
|
(empty($data[$method]['sub_code']) ? '' : "{$data[$method]['sub_msg']} [{$data[$method]['sub_code']}]\r\n"),
|
||||||
|
$data[$method]['code'], $data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $data[$method];
|
||||||
|
// 返回结果签名检查
|
||||||
|
// return $this->verify($data[$method], $data['sign']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据包生成及数据签名
|
||||||
|
* @param array $options
|
||||||
|
*/
|
||||||
|
protected function applyData($options)
|
||||||
|
{
|
||||||
|
if ($this->config->get('app_cert') && $this->config->get('root_cert')) {
|
||||||
|
$this->setAppCertSnAndRootCertSn();
|
||||||
|
}
|
||||||
|
$this->options->set('biz_content', json_encode($this->params->merge($options), 256));
|
||||||
|
$this->options->set('sign', $this->getSign());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版 设置网关应用公钥证书SN、支付宝根证书SN
|
||||||
|
*/
|
||||||
|
protected function setAppCertSnAndRootCertSn()
|
||||||
|
{
|
||||||
|
if (!($appCert = $this->config->get('app_cert'))) {
|
||||||
|
throw new InvalidArgumentException('Missing Config -- [app_cert|app_cert_path]');
|
||||||
|
}
|
||||||
|
if (!($rootCert = $this->config->get('root_cert'))) {
|
||||||
|
throw new InvalidArgumentException('Missing Config -- [root_cert|alipay_root_path]');
|
||||||
|
}
|
||||||
|
$this->options->set('app_cert_sn', $this->getAppCertSN($appCert));
|
||||||
|
$this->options->set('alipay_root_cert_sn', $this->getRootCertSN($rootCert));
|
||||||
|
if (!$this->options->get('app_cert_sn')) {
|
||||||
|
throw new InvalidArgumentException('Missing options -- [app_cert_sn]');
|
||||||
|
}
|
||||||
|
if (!$this->options->get('alipay_root_cert_sn')) {
|
||||||
|
throw new InvalidArgumentException('Missing options -- [alipay_root_cert_sn]');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版 从证书中提取序列号
|
||||||
|
* @param string $sign
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function getAppCertSN($sign)
|
||||||
|
{
|
||||||
|
$ssl = openssl_x509_parse($sign, true);
|
||||||
|
$issuer = isset($ssl['issuer']) && is_array($ssl['issuer']) ? $ssl['issuer'] : [];
|
||||||
|
return md5($this->_arr2str(array_reverse($issuer)) . $ssl['serialNumber']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版 数组转字符串
|
||||||
|
* @param array $array
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function _arr2str($array)
|
||||||
|
{
|
||||||
|
$string = [];
|
||||||
|
if ($array && is_array($array)) {
|
||||||
|
foreach ($array as $key => $value) {
|
||||||
|
$string[] = $key . '=' . $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return join(',', $string);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版 提取根证书序列号
|
||||||
|
* @param string $sign
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
private function getRootCertSN($sign)
|
||||||
|
{
|
||||||
|
if (strlen($sign) < 500 && file_exists($sign)) {
|
||||||
|
$sign = file_get_contents($sign);
|
||||||
|
}
|
||||||
|
$sn = null;
|
||||||
|
$array = explode('-----END CERTIFICATE-----', $sign);
|
||||||
|
for ($i = 0; $i < count($array) - 1; $i++) {
|
||||||
|
$ssl[$i] = openssl_x509_parse($array[$i] . '-----END CERTIFICATE-----', true);
|
||||||
|
if (strpos($ssl[$i]['serialNumber'], '0x') === 0) {
|
||||||
|
$ssl[$i]['serialNumber'] = $this->_hex2dec($ssl[$i]['serialNumberHex']);
|
||||||
|
}
|
||||||
|
if ($ssl[$i]['signatureTypeLN'] == 'sha1WithRSAEncryption' || $ssl[$i]['signatureTypeLN'] == 'sha256WithRSAEncryption') {
|
||||||
|
$issuer = isset($ssl[$i]['issuer']) && is_array($ssl[$i]['issuer']) ? $ssl[$i]['issuer'] : [];
|
||||||
|
if ($sn == null) {
|
||||||
|
$sn = md5($this->_arr2str(array_reverse($issuer)) . $ssl[$i]['serialNumber']);
|
||||||
|
} else {
|
||||||
|
$sn = $sn . '_' . md5($this->_arr2str(array_reverse($issuer)) . $ssl[$i]['serialNumber']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $sn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版 0x转高精度数字
|
||||||
|
* @param string $hex
|
||||||
|
* @return int|string
|
||||||
|
*/
|
||||||
|
private function _hex2dec($hex)
|
||||||
|
{
|
||||||
|
list($dec, $len) = [0, strlen($hex)];
|
||||||
|
for ($i = 1; $i <= $len; $i++) {
|
||||||
|
$dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
|
||||||
|
}
|
||||||
|
return $dec;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据签名
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function getSign()
|
||||||
|
{
|
||||||
|
if ($this->options->get('sign_type') === 'RSA2') {
|
||||||
|
openssl_sign($this->getSignContent($this->options->get(), true), $sign, $this->getAppPrivateKey(), OPENSSL_ALGO_SHA256);
|
||||||
|
} else {
|
||||||
|
openssl_sign($this->getSignContent($this->options->get(), true), $sign, $this->getAppPrivateKey(), OPENSSL_ALGO_SHA1);
|
||||||
|
}
|
||||||
|
return base64_encode($sign);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据签名处理
|
||||||
|
* @param array $data 需要进行签名数据
|
||||||
|
* @param boolean $needSignType 是否需要sign_type字段
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function getSignContent(array $data, $needSignType = false)
|
||||||
|
{
|
||||||
|
list($attrs,) = [[], ksort($data)];
|
||||||
|
if (isset($data['sign'])) unset($data['sign']);
|
||||||
|
if (empty($needSignType)) unset($data['sign_type']);
|
||||||
|
foreach ($data as $key => $value) {
|
||||||
|
if ($value === '' || is_null($value)) continue;
|
||||||
|
$attrs[] = "{$key}={$value}";
|
||||||
|
}
|
||||||
|
return join('&', $attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取应用私钥内容
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function getAppPrivateKey()
|
||||||
|
{
|
||||||
|
$content = wordwrap($this->trimCert($this->config->get('private_key')), 64, "\n", true);
|
||||||
|
return "-----BEGIN RSA PRIVATE KEY-----\n{$content}\n-----END RSA PRIVATE KEY-----";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去除证书前后内容及空白
|
||||||
|
* @param string $sign
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function trimCert($sign)
|
||||||
|
{
|
||||||
|
return preg_replace(['/\s+/', '/-{5}.*?-{5}/'], '', $sign);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝订单退款操作
|
* 支付宝订单退款操作
|
||||||
* @param array|string $options 退款参数或退款商户订单号
|
* @param array|string $options 退款参数或退款商户订单号
|
||||||
@ -204,6 +381,116 @@ abstract class BasicAliPay
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取支付公钥内容
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getAliPublicKey()
|
||||||
|
{
|
||||||
|
$cert = $this->config->get('public_key');
|
||||||
|
if (strpos(trim($cert), '-----BEGIN CERTIFICATE-----') !== false) {
|
||||||
|
$pkey = openssl_pkey_get_public($cert);
|
||||||
|
$keyData = openssl_pkey_get_details($pkey);
|
||||||
|
return trim($keyData['key']);
|
||||||
|
} else {
|
||||||
|
$content = wordwrap($this->trimCert($cert), 64, "\n", true);
|
||||||
|
return "-----BEGIN PUBLIC KEY-----\n{$content}\n-----END PUBLIC KEY-----";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用数据操作
|
||||||
|
* @param array $options
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
abstract public function apply($options);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用接口调用(支付宝开放平台)
|
||||||
|
* @param string $apiMethod API 方法名(如 alipay.trade.query),必填
|
||||||
|
* @param array|string $data 业务参数,数组会写入 biz_content;字符串尝试解析为 JSON
|
||||||
|
* @param string $method GET|POST|PUT|DELETE|PATCH,默认 GET(POST 会放入表单)
|
||||||
|
* @param bool $verify 是否验证返回签名
|
||||||
|
* @return array 返回解析后的响应体
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public function callApi($apiMethod, $data = [], $method = 'GET', $verify = false)
|
||||||
|
{
|
||||||
|
$method = strtoupper($method);
|
||||||
|
|
||||||
|
// 验证API方法名(必填)
|
||||||
|
if (empty($apiMethod)) {
|
||||||
|
throw new \WeChat\Exceptions\InvalidArgumentException("Missing required parameter -- [apiMethod]");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用gateway作为URL
|
||||||
|
$url = $this->gateway;
|
||||||
|
|
||||||
|
// 设置API方法
|
||||||
|
$this->options->set('method', $apiMethod);
|
||||||
|
|
||||||
|
// 处理数据格式并合并参数
|
||||||
|
$params = [];
|
||||||
|
if (is_array($data)) {
|
||||||
|
$params = $data;
|
||||||
|
} elseif (is_string($data) && !empty($data)) {
|
||||||
|
$decoded = json_decode($data, true);
|
||||||
|
if (json_last_error() === JSON_ERROR_NONE) {
|
||||||
|
$params = $decoded;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($params)) {
|
||||||
|
$this->params->merge($params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理签名(默认自动签名)
|
||||||
|
if ($this->config->get('app_cert') && $this->config->get('root_cert')) {
|
||||||
|
$this->setAppCertSnAndRootCertSn();
|
||||||
|
}
|
||||||
|
$this->options->set('biz_content', json_encode($this->params->get(), 256));
|
||||||
|
$this->options->set('sign', $this->getSign());
|
||||||
|
|
||||||
|
// 统一处理响应(减少重复代码)
|
||||||
|
$methodKey = str_replace('.', '_', $this->options->get('method')) . '_response';
|
||||||
|
$self = $this;
|
||||||
|
$processResponse = function ($response) use ($verify, $methodKey, $self) {
|
||||||
|
$data = json_decode($response, true);
|
||||||
|
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||||
|
return $response; // JSON解析失败,返回原始响应
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证响应签名
|
||||||
|
if ($verify && isset($data['sign']) && isset($data[$methodKey])) {
|
||||||
|
return $self->verify($data[$methodKey], $data['sign']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查错误
|
||||||
|
if (isset($data[$methodKey])) {
|
||||||
|
if (isset($data[$methodKey]['code']) && $data[$methodKey]['code'] !== '10000') {
|
||||||
|
$msg = isset($data[$methodKey]['msg']) ? "{$data[$methodKey]['msg']} [{$data[$methodKey]['code']}]\r\n" : '';
|
||||||
|
$subMsg = isset($data[$methodKey]['sub_msg']) ? "{$data[$methodKey]['sub_msg']} [{$data[$methodKey]['sub_code']}]\r\n" : '';
|
||||||
|
throw new InvalidResponseException("Error: " . $msg . $subMsg, $data[$methodKey]['code'], $data);
|
||||||
|
}
|
||||||
|
return $data[$methodKey];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
};
|
||||||
|
|
||||||
|
// GET/HEAD/OPTIONS请求
|
||||||
|
if (in_array($method, ['GET', 'HEAD', 'OPTIONS'])) {
|
||||||
|
$queryParams = array_merge($this->options->get(), $params);
|
||||||
|
$response = Tools::get($url, $queryParams);
|
||||||
|
return $processResponse($response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST/PUT/PATCH/DELETE请求
|
||||||
|
$postData = array_merge($this->options->get(), $params);
|
||||||
|
$response = Tools::doRequest($method, $url, ['data' => $postData]);
|
||||||
|
return $processResponse($response);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证接口返回的数据签名
|
* 验证接口返回的数据签名
|
||||||
* @param array $data 通知数据
|
* @param array $data 通知数据
|
||||||
@ -226,86 +513,6 @@ abstract class BasicAliPay
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取数据签名
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function getSign()
|
|
||||||
{
|
|
||||||
if ($this->options->get('sign_type') === 'RSA2') {
|
|
||||||
openssl_sign($this->getSignContent($this->options->get(), true), $sign, $this->getAppPrivateKey(), OPENSSL_ALGO_SHA256);
|
|
||||||
} else {
|
|
||||||
openssl_sign($this->getSignContent($this->options->get(), true), $sign, $this->getAppPrivateKey(), OPENSSL_ALGO_SHA1);
|
|
||||||
}
|
|
||||||
return base64_encode($sign);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 去除证书前后内容及空白
|
|
||||||
* @param string $sign
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function trimCert($sign)
|
|
||||||
{
|
|
||||||
return preg_replace(['/\s+/', '/-{5}.*?-{5}/'], '', $sign);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据签名处理
|
|
||||||
* @param array $data 需要进行签名数据
|
|
||||||
* @param boolean $needSignType 是否需要sign_type字段
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function getSignContent(array $data, $needSignType = false)
|
|
||||||
{
|
|
||||||
list($attrs,) = [[], ksort($data)];
|
|
||||||
if (isset($data['sign'])) unset($data['sign']);
|
|
||||||
if (empty($needSignType)) unset($data['sign_type']);
|
|
||||||
foreach ($data as $key => $value) {
|
|
||||||
if ($value === '' || is_null($value)) continue;
|
|
||||||
$attrs[] = "{$key}={$value}";
|
|
||||||
}
|
|
||||||
return join('&', $attrs);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据包生成及数据签名
|
|
||||||
* @param array $options
|
|
||||||
*/
|
|
||||||
protected function applyData($options)
|
|
||||||
{
|
|
||||||
if ($this->config->get('app_cert') && $this->config->get('root_cert')) {
|
|
||||||
$this->setAppCertSnAndRootCertSn();
|
|
||||||
}
|
|
||||||
$this->options->set('biz_content', json_encode($this->params->merge($options), 256));
|
|
||||||
$this->options->set('sign', $this->getSign());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求接口并验证访问数据
|
|
||||||
* @param array $options
|
|
||||||
* @return array|boolean
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
protected function getResult($options)
|
|
||||||
{
|
|
||||||
$this->applyData($options);
|
|
||||||
$method = str_replace('.', '_', $this->options['method']) . '_response';
|
|
||||||
$data = json_decode(Tools::get($this->gateway, $this->options->get()), true);
|
|
||||||
if (!isset($data[$method]['code']) || $data[$method]['code'] !== '10000') {
|
|
||||||
throw new InvalidResponseException(
|
|
||||||
"Error: " .
|
|
||||||
(empty($data[$method]['code']) ? '' : "{$data[$method]['msg']} [{$data[$method]['code']}]\r\n") .
|
|
||||||
(empty($data[$method]['sub_code']) ? '' : "{$data[$method]['sub_msg']} [{$data[$method]['sub_code']}]\r\n"),
|
|
||||||
$data[$method]['code'], $data
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return $data[$method];
|
|
||||||
// 返回结果签名检查
|
|
||||||
// return $this->verify($data[$method], $data['sign']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成支付HTML代码
|
* 生成支付HTML代码
|
||||||
* @return string
|
* @return string
|
||||||
@ -320,128 +527,4 @@ abstract class BasicAliPay
|
|||||||
$html .= "<input type='submit' value='ok' style='display:none;'></form>";
|
$html .= "<input type='submit' value='ok' style='display:none;'></form>";
|
||||||
return "{$html}<script>document.forms['alipaysubmit'].submit();</script>";
|
return "{$html}<script>document.forms['alipaysubmit'].submit();</script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取应用私钥内容
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function getAppPrivateKey()
|
|
||||||
{
|
|
||||||
$content = wordwrap($this->trimCert($this->config->get('private_key')), 64, "\n", true);
|
|
||||||
return "-----BEGIN RSA PRIVATE KEY-----\n{$content}\n-----END RSA PRIVATE KEY-----";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取支付公钥内容
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAliPublicKey()
|
|
||||||
{
|
|
||||||
$cert = $this->config->get('public_key');
|
|
||||||
if (strpos(trim($cert), '-----BEGIN CERTIFICATE-----') !== false) {
|
|
||||||
$pkey = openssl_pkey_get_public($cert);
|
|
||||||
$keyData = openssl_pkey_get_details($pkey);
|
|
||||||
return trim($keyData['key']);
|
|
||||||
} else {
|
|
||||||
$content = wordwrap($this->trimCert($cert), 64, "\n", true);
|
|
||||||
return "-----BEGIN PUBLIC KEY-----\n{$content}\n-----END PUBLIC KEY-----";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新版 从证书中提取序列号
|
|
||||||
* @param string $sign
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function getAppCertSN($sign)
|
|
||||||
{
|
|
||||||
$ssl = openssl_x509_parse($sign, true);
|
|
||||||
return md5($this->_arr2str(array_reverse($ssl['issuer'])) . $ssl['serialNumber']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新版 提取根证书序列号
|
|
||||||
* @param string $sign
|
|
||||||
* @return string|null
|
|
||||||
*/
|
|
||||||
private function getRootCertSN($sign)
|
|
||||||
{
|
|
||||||
if (strlen($sign) < 500 && file_exists($sign)) {
|
|
||||||
$sign = file_get_contents($sign);
|
|
||||||
}
|
|
||||||
$sn = null;
|
|
||||||
$array = explode('-----END CERTIFICATE-----', $sign);
|
|
||||||
for ($i = 0; $i < count($array) - 1; $i++) {
|
|
||||||
$ssl[$i] = openssl_x509_parse($array[$i] . '-----END CERTIFICATE-----', true);
|
|
||||||
if (strpos($ssl[$i]['serialNumber'], '0x') === 0) {
|
|
||||||
$ssl[$i]['serialNumber'] = $this->_hex2dec($ssl[$i]['serialNumberHex']);
|
|
||||||
}
|
|
||||||
if ($ssl[$i]['signatureTypeLN'] == 'sha1WithRSAEncryption' || $ssl[$i]['signatureTypeLN'] == 'sha256WithRSAEncryption') {
|
|
||||||
if ($sn == null) {
|
|
||||||
$sn = md5($this->_arr2str(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']);
|
|
||||||
} else {
|
|
||||||
$sn = $sn . '_' . md5($this->_arr2str(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $sn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新版 设置网关应用公钥证书SN、支付宝根证书SN
|
|
||||||
*/
|
|
||||||
protected function setAppCertSnAndRootCertSn()
|
|
||||||
{
|
|
||||||
if (!($appCert = $this->config->get('app_cert'))) {
|
|
||||||
throw new InvalidArgumentException('Missing Config -- [app_cert|app_cert_path]');
|
|
||||||
}
|
|
||||||
if (!($rootCert = $this->config->get('root_cert'))) {
|
|
||||||
throw new InvalidArgumentException('Missing Config -- [root_cert|alipay_root_path]');
|
|
||||||
}
|
|
||||||
$this->options->set('app_cert_sn', $this->getAppCertSN($appCert));
|
|
||||||
$this->options->set('alipay_root_cert_sn', $this->getRootCertSN($rootCert));
|
|
||||||
if (!$this->options->get('app_cert_sn')) {
|
|
||||||
throw new InvalidArgumentException('Missing options -- [app_cert_sn]');
|
|
||||||
}
|
|
||||||
if (!$this->options->get('alipay_root_cert_sn')) {
|
|
||||||
throw new InvalidArgumentException('Missing options -- [alipay_root_cert_sn]');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新版 数组转字符串
|
|
||||||
* @param array $array
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function _arr2str($array)
|
|
||||||
{
|
|
||||||
$string = [];
|
|
||||||
if ($array && is_array($array)) {
|
|
||||||
foreach ($array as $key => $value) {
|
|
||||||
$string[] = $key . '=' . $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return join(',', $string);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新版 0x转高精度数字
|
|
||||||
* @param string $hex
|
|
||||||
* @return int|string
|
|
||||||
*/
|
|
||||||
private function _hex2dec($hex)
|
|
||||||
{
|
|
||||||
list($dec, $len) = [0, strlen($hex)];
|
|
||||||
for ($i = 1; $i <= $len; $i++) {
|
|
||||||
$dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
|
|
||||||
}
|
|
||||||
return $dec;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用数据操作
|
|
||||||
* @param array $options
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
abstract public function apply($options);
|
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -23,7 +23,6 @@ use WeChat\Prpcrypt\Prpcrypt;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信通知处理基本类
|
* 微信通知处理基本类
|
||||||
* Class BasicPushEvent
|
|
||||||
* @package WeChat\Contracts
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class BasicPushEvent
|
class BasicPushEvent
|
||||||
@ -118,6 +117,30 @@ class BasicPushEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息是否需要加密
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isEncrypt()
|
||||||
|
{
|
||||||
|
return $this->encryptType === 'aes';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证来自微信服务器
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function checkSignature()
|
||||||
|
{
|
||||||
|
$nonce = $this->input->get('nonce');
|
||||||
|
$timestamp = $this->input->get('timestamp');
|
||||||
|
$msg_signature = $this->input->get('msg_signature');
|
||||||
|
$signature = empty($msg_signature) ? $this->input->get('signature') : $msg_signature;
|
||||||
|
$tmpArr = [$this->config->get('token'), $timestamp, $nonce, ''];
|
||||||
|
sort($tmpArr, SORT_STRING);
|
||||||
|
return sha1(implode($tmpArr)) === $signature;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取回显字串
|
* 获取回显字串
|
||||||
* @return string
|
* @return string
|
||||||
@ -131,15 +154,6 @@ class BasicPushEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息是否需要加密
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function isEncrypt()
|
|
||||||
{
|
|
||||||
return $this->encryptType === 'aes';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回复消息
|
* 回复消息
|
||||||
* @param array $data 消息内容
|
* @param array $data 消息内容
|
||||||
@ -171,21 +185,6 @@ class BasicPushEvent
|
|||||||
echo $xml;
|
echo $xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 验证来自微信服务器
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private function checkSignature()
|
|
||||||
{
|
|
||||||
$nonce = $this->input->get('nonce');
|
|
||||||
$timestamp = $this->input->get('timestamp');
|
|
||||||
$msg_signature = $this->input->get('msg_signature');
|
|
||||||
$signature = empty($msg_signature) ? $this->input->get('signature') : $msg_signature;
|
|
||||||
$tmpArr = [$this->config->get('token'), $timestamp, $nonce, ''];
|
|
||||||
sort($tmpArr, SORT_STRING);
|
|
||||||
return sha1(implode($tmpArr)) === $signature;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取公众号推送对象
|
* 获取公众号推送对象
|
||||||
* @param null|string $field 指定获取字段
|
* @param null|string $field 指定获取字段
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,42 +20,37 @@ use WeChat\Exceptions\InvalidArgumentException;
|
|||||||
use WeChat\Exceptions\InvalidResponseException;
|
use WeChat\Exceptions\InvalidResponseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BasicWeChat
|
* 微信基础类
|
||||||
* @package WeChat\Contracts
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class BasicWeChat
|
class BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 静态缓存
|
||||||
|
* @var static
|
||||||
|
*/
|
||||||
|
protected static $cache;
|
||||||
/**
|
/**
|
||||||
* 当前微信配置
|
* 当前微信配置
|
||||||
* @var DataArray
|
* @var DataArray
|
||||||
*/
|
*/
|
||||||
public $config;
|
public $config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访问AccessToken
|
* 访问AccessToken
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $access_token = '';
|
public $access_token = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前请求方法参数
|
* 当前请求方法参数
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $currentMethod = [];
|
protected $currentMethod = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前模式
|
* 当前模式
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $isTry = false;
|
protected $isTry = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* 静态缓存
|
|
||||||
* @var static
|
|
||||||
*/
|
|
||||||
protected static $cache;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册代替函数
|
* 注册代替函数
|
||||||
* @var string
|
* @var string
|
||||||
@ -85,7 +80,7 @@ class BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 静态创建对象
|
* 静态创建对象
|
||||||
* @param array $config
|
* @param array $config 配置(appid、appsecret 等)
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function instance(array $config)
|
public static function instance(array $config)
|
||||||
@ -95,6 +90,37 @@ class BasicWeChat
|
|||||||
return self::$cache[$key] = new static($config);
|
return self::$cache[$key] = new static($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口通用POST请求方法
|
||||||
|
* @param string $url 接口URL
|
||||||
|
* @param array $data POST提交接口参数
|
||||||
|
* @param bool $toJson 是否转换为JSON参数
|
||||||
|
* @return array
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public function callPostApi($url, array $data, $toJson = true, array $options = [])
|
||||||
|
{
|
||||||
|
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||||
|
return $this->httpPostForJson($url, $data, $toJson, $options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册当前请求接口
|
||||||
|
* @param string $url 接口地址
|
||||||
|
* @param string $method 当前接口方法
|
||||||
|
* @param array $arguments 请求参数
|
||||||
|
* @return string
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
protected function registerApi(&$url, $method, $arguments = [])
|
||||||
|
{
|
||||||
|
$this->currentMethod = ['method' => $method, 'arguments' => $arguments];
|
||||||
|
if (empty($this->access_token)) $this->access_token = $this->getAccessToken();
|
||||||
|
return $url = str_replace('ACCESS_TOKEN', urlencode($this->access_token), $url);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取访问 AccessToken
|
* 获取访问 AccessToken
|
||||||
* @return string
|
* @return string
|
||||||
@ -147,38 +173,6 @@ class BasicWeChat
|
|||||||
Tools::setCache($cache, $this->access_token = $accessToken);
|
Tools::setCache($cache, $this->access_token = $accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 清理删除 AccessToken
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function delAccessToken()
|
|
||||||
{
|
|
||||||
$this->access_token = '';
|
|
||||||
return Tools::delCache($this->config->get('appid') . '_access_token');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 以GET获取接口数据并转为数组
|
|
||||||
* @param string $url 接口地址
|
|
||||||
* @return array
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
protected function httpGetForJson($url)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
return Tools::json2arr(Tools::get($url));
|
|
||||||
} catch (InvalidResponseException $exception) {
|
|
||||||
if (isset($this->currentMethod['method']) && empty($this->isTry)) {
|
|
||||||
if (in_array($exception->getCode(), ['40014', '40001', '41001', '42001'])) {
|
|
||||||
[$this->delAccessToken(), $this->isTry = true];
|
|
||||||
return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new InvalidResponseException($exception->getMessage(), $exception->getCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 以POST获取接口数据并转为数组
|
* 以POST获取接口数据并转为数组
|
||||||
* @param string $url 接口地址
|
* @param string $url 接口地址
|
||||||
@ -205,39 +199,18 @@ class BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册当前请求接口
|
* 清理删除 AccessToken
|
||||||
* @param string $url 接口地址
|
* @return bool
|
||||||
* @param string $method 当前接口方法
|
|
||||||
* @param array $arguments 请求参数
|
|
||||||
* @return string
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
*/
|
||||||
protected function registerApi(&$url, $method, $arguments = [])
|
public function delAccessToken()
|
||||||
{
|
{
|
||||||
$this->currentMethod = ['method' => $method, 'arguments' => $arguments];
|
$this->access_token = '';
|
||||||
if (empty($this->access_token)) $this->access_token = $this->getAccessToken();
|
return Tools::delCache($this->config->get('appid') . '_access_token');
|
||||||
return $url = str_replace('ACCESS_TOKEN', urlencode($this->access_token), $url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口通用POST请求方法
|
* 通用 GET 请求(自动处理 ACCESS_TOKEN)
|
||||||
* @param string $url 接口URL
|
* @param string $url 接口 URL
|
||||||
* @param array $data POST提交接口参数
|
|
||||||
* @param bool $toJson 是否转换为JSON参数
|
|
||||||
* @return array
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
public function callPostApi($url, array $data, $toJson = true, array $options = [])
|
|
||||||
{
|
|
||||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
|
||||||
return $this->httpPostForJson($url, $data, $toJson, $options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接口通用GET请求方法
|
|
||||||
* @param string $url 接口URL
|
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -248,4 +221,70 @@ class BasicWeChat
|
|||||||
return $this->httpGetForJson($url);
|
return $this->httpGetForJson($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以GET获取接口数据并转为数组
|
||||||
|
* @param string $url 接口地址
|
||||||
|
* @return array
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
protected function httpGetForJson($url)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return Tools::json2arr(Tools::get($url));
|
||||||
|
} catch (InvalidResponseException $exception) {
|
||||||
|
if (isset($this->currentMethod['method']) && empty($this->isTry)) {
|
||||||
|
if (in_array($exception->getCode(), ['40014', '40001', '41001', '42001'])) {
|
||||||
|
[$this->delAccessToken(), $this->isTry = true];
|
||||||
|
return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new InvalidResponseException($exception->getMessage(), $exception->getCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用接口调用
|
||||||
|
* @param string $url 完整 URL 或相对路径,支持 ACCESS_TOKEN 占位符自动替换
|
||||||
|
* @param array|string $data GET 参数或请求体,数组自动 JSON;字符串原样发送
|
||||||
|
* @param string $method GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS,默认 GET
|
||||||
|
* @return array 解析后的数组
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public function callApi($url, $data = [], $method = 'GET')
|
||||||
|
{
|
||||||
|
$method = strtoupper($method);
|
||||||
|
|
||||||
|
// 自动处理ACCESS_TOKEN
|
||||||
|
if (strpos($url, 'ACCESS_TOKEN') !== false) {
|
||||||
|
if (empty($this->access_token)) {
|
||||||
|
$this->access_token = $this->getAccessToken();
|
||||||
|
}
|
||||||
|
$url = str_replace('ACCESS_TOKEN', urlencode($this->access_token), $url);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET/HEAD/OPTIONS请求(无请求体)
|
||||||
|
if (in_array($method, ['GET', 'HEAD', 'OPTIONS'])) {
|
||||||
|
if (!empty($data) && is_array($data)) {
|
||||||
|
$url .= (strpos($url, '?') !== false ? '&' : '?') . http_build_query($data);
|
||||||
|
}
|
||||||
|
return $this->httpGetForJson($url);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST/PUT/PATCH/DELETE请求(有请求体)
|
||||||
|
$postData = is_array($data) ? $data : [];
|
||||||
|
$toJson = is_array($data);
|
||||||
|
|
||||||
|
// POST请求使用原有方法(支持自动重试)
|
||||||
|
if ($method === 'POST') {
|
||||||
|
return $this->httpPostForJson($url, $postData, $toJson, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
// PUT/PATCH/DELETE请求直接调用
|
||||||
|
$requestData = is_string($data) ? $data : Tools::arr2json($postData);
|
||||||
|
$response = Tools::doRequest($method, $url, ['data' => $requestData]);
|
||||||
|
return Tools::json2arr($response);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -21,17 +21,20 @@ use WeChat\Exceptions\InvalidResponseException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付基础类
|
* 微信支付基础类
|
||||||
* Class BasicPay
|
|
||||||
* @package WeChat\Contracts
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class BasicWePay
|
class BasicWePay
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 静态缓存
|
||||||
|
* @var static
|
||||||
|
*/
|
||||||
|
protected static $cache;
|
||||||
/**
|
/**
|
||||||
* 商户配置
|
* 商户配置
|
||||||
* @var DataArray
|
* @var DataArray
|
||||||
*/
|
*/
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前请求数据
|
* 当前请求数据
|
||||||
* @var DataArray
|
* @var DataArray
|
||||||
@ -39,14 +42,8 @@ class BasicWePay
|
|||||||
protected $params;
|
protected $params;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 静态缓存
|
* 构造函数
|
||||||
* @var static
|
* @param array $options 必填:appid、mch_id、mch_key,可选:sub_appid、sub_mch_id、cache_path
|
||||||
*/
|
|
||||||
protected static $cache;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WeChat constructor.
|
|
||||||
* @param array $options
|
|
||||||
*/
|
*/
|
||||||
public function __construct(array $options)
|
public function __construct(array $options)
|
||||||
{
|
{
|
||||||
@ -80,7 +77,7 @@ class BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 静态创建对象
|
* 静态创建对象
|
||||||
* @param array $config
|
* @param array $config 商户配置
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function instance(array $config)
|
public static function instance(array $config)
|
||||||
@ -91,9 +88,9 @@ class BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取微信支付通知
|
* 获取微信支付异步通知并验签
|
||||||
* @param string|array $xml
|
* @param string|array $xml 可选,默认读取原始输入
|
||||||
* @return array
|
* @return array 验签通过的通知数据
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function getNotify($xml = '')
|
public function getNotify($xml = '')
|
||||||
@ -105,21 +102,12 @@ class BasicWePay
|
|||||||
throw new InvalidResponseException('Invalid Notify.', '0');
|
throw new InvalidResponseException('Invalid Notify.', '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取微信支付通知回复内容
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getNotifySuccessReply()
|
|
||||||
{
|
|
||||||
return Tools::arr2xml(['return_code' => 'SUCCESS', 'return_msg' => 'OK']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成支付签名
|
* 生成支付签名
|
||||||
* @param array $data 参与签名的数据
|
* @param array $data 待签名数据
|
||||||
* @param string $signType 参与签名的类型
|
* @param string $signType MD5|HMAC-SHA256
|
||||||
* @param string $buff 参与签名字符串前缀
|
* @param string $buff 签名前缀(内部使用)
|
||||||
* @return string
|
* @return string 大写签名
|
||||||
*/
|
*/
|
||||||
public function getPaySign(array $data, $signType = 'MD5', $buff = '')
|
public function getPaySign(array $data, $signType = 'MD5', $buff = '')
|
||||||
{
|
{
|
||||||
@ -137,8 +125,17 @@ class BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转换短链接
|
* 获取微信支付通知成功回复 XML
|
||||||
* @param string $longUrl 需要转换的URL,签名用原串,传输需URLencode
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getNotifySuccessReply()
|
||||||
|
{
|
||||||
|
return Tools::arr2xml(['return_code' => 'SUCCESS', 'return_msg' => 'OK']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转换短链接(tools/shorturl)
|
||||||
|
* @param string $longUrl 需转换的URL,签名用原串,传输需URLencode
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -150,27 +147,14 @@ class BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数组直接转xml数据输出
|
* 基础 POST 调用(自动签名,可选双向证书)
|
||||||
* @param array $data
|
* @param string $url 请求地址
|
||||||
* @param bool $isReturn
|
|
||||||
* @return string|void
|
|
||||||
*/
|
|
||||||
public function toXml(array $data, $isReturn = false)
|
|
||||||
{
|
|
||||||
$xml = Tools::arr2xml($data);
|
|
||||||
if ($isReturn) return $xml;
|
|
||||||
echo $xml;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 以 Post 请求接口
|
|
||||||
* @param string $url 请求
|
|
||||||
* @param array $data 接口参数
|
* @param array $data 接口参数
|
||||||
* @param bool $isCert 是否需要使用双向证书
|
* @param bool $isCert 是否需要双向证书(退款等场景)
|
||||||
* @param string $signType 数据签名类型 MD5|SHA256
|
* @param string $signType MD5|HMAC-SHA256
|
||||||
* @param bool $needSignType 是否需要传签名类型参数
|
* @param bool $needSignType 是否追加 sign_type 字段
|
||||||
* @param bool $needNonceStr
|
* @param bool $needNonceStr 是否自动附加 nonce_str
|
||||||
* @return array
|
* @return array XML 解析结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -205,4 +189,92 @@ class BasicWePay
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数组转 XML 输出
|
||||||
|
* @param array $data 待转换数据
|
||||||
|
* @param bool $isReturn true 返回字符串,false 直接输出
|
||||||
|
* @return string|void
|
||||||
|
*/
|
||||||
|
public function toXml(array $data, $isReturn = false)
|
||||||
|
{
|
||||||
|
$xml = Tools::arr2xml($data);
|
||||||
|
if ($isReturn) return $xml;
|
||||||
|
echo $xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用接口(V2)调用
|
||||||
|
* @param string $url 完整 URL
|
||||||
|
* @param array|string $data 请求参数,数组自动补全商户参数并签名;字符串原样发送
|
||||||
|
* @param string $method GET|POST|PUT|DELETE|PATCH,默认 POST(GET/HEAD/OPTIONS 不带签名)
|
||||||
|
* @param bool $isCert 是否启用双向证书
|
||||||
|
* @param string $signType MD5|HMAC-SHA256,默认 HMAC-SHA256
|
||||||
|
* @return array XML 解析结果
|
||||||
|
* @throws \WeChat\Exceptions\InvalidArgumentException
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public function callApi($url, $data = [], $method = 'POST', $isCert = false, $signType = 'HMAC-SHA256')
|
||||||
|
{
|
||||||
|
$method = strtoupper($method);
|
||||||
|
|
||||||
|
// 处理数据格式
|
||||||
|
$requestData = is_array($data) ? $data : (is_string($data) ? $data : []);
|
||||||
|
|
||||||
|
// GET/HEAD/OPTIONS请求(无请求体,不签名)
|
||||||
|
if (in_array($method, ['GET', 'HEAD', 'OPTIONS'])) {
|
||||||
|
if (!empty($requestData) && is_array($requestData)) {
|
||||||
|
$url .= (strpos($url, '?') !== false ? '&' : '?') . http_build_query($requestData);
|
||||||
|
}
|
||||||
|
$response = Tools::get($url);
|
||||||
|
$result = Tools::xml2arr($response);
|
||||||
|
if (isset($result['return_code']) && $result['return_code'] !== 'SUCCESS') {
|
||||||
|
throw new InvalidResponseException($result['return_msg'], '0');
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST/PUT/PATCH/DELETE请求(有请求体)
|
||||||
|
$option = [];
|
||||||
|
if ($isCert) {
|
||||||
|
$option['ssl_p12'] = $this->config->get('ssl_p12');
|
||||||
|
$option['ssl_cer'] = $this->config->get('ssl_cer');
|
||||||
|
$option['ssl_key'] = $this->config->get('ssl_key');
|
||||||
|
if (is_string($option['ssl_p12']) && file_exists($option['ssl_p12'])) {
|
||||||
|
$content = file_get_contents($option['ssl_p12']);
|
||||||
|
if (openssl_pkcs12_read($content, $certs, $this->config->get('mch_id'))) {
|
||||||
|
$option['ssl_key'] = Tools::pushFile(md5($certs['pkey']) . '.pem', $certs['pkey']);
|
||||||
|
$option['ssl_cer'] = Tools::pushFile(md5($certs['cert']) . '.pem', $certs['cert']);
|
||||||
|
} else {
|
||||||
|
throw new InvalidArgumentException("P12 certificate does not match MCH_ID --- ssl_p12");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($option['ssl_cer']) || !file_exists($option['ssl_cer'])) {
|
||||||
|
throw new InvalidArgumentException("Missing Config -- ssl_cer", '0');
|
||||||
|
}
|
||||||
|
if (empty($option['ssl_key']) || !file_exists($option['ssl_key'])) {
|
||||||
|
throw new InvalidArgumentException("Missing Config -- ssl_key", '0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合并参数并处理签名(默认自动签名)
|
||||||
|
if (is_array($requestData)) {
|
||||||
|
$params = $this->params->merge($requestData);
|
||||||
|
$params['sign_type'] = strtoupper($signType);
|
||||||
|
$params['sign'] = $this->getPaySign($params, $signType);
|
||||||
|
$option['data'] = Tools::arr2xml($params);
|
||||||
|
} else {
|
||||||
|
$option['data'] = $requestData;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用doRequest支持PUT/DELETE/PATCH
|
||||||
|
$response = Tools::doRequest($method, $url, $option);
|
||||||
|
|
||||||
|
$result = Tools::xml2arr($response);
|
||||||
|
if (isset($result['return_code']) && $result['return_code'] !== 'SUCCESS') {
|
||||||
|
throw new InvalidResponseException($result['return_msg'], '0');
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -18,7 +18,6 @@ namespace WeChat\Contracts;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业微信基础类
|
* 企业微信基础类
|
||||||
* Class BasicWeWork
|
|
||||||
* @package WeChat\Contracts
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class BasicWeWork extends BasicWeChat
|
class BasicWeWork extends BasicWeChat
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,8 +19,8 @@ namespace WeChat\Contracts;
|
|||||||
use ArrayAccess;
|
use ArrayAccess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DataArray
|
* 数据处理类
|
||||||
* @package WeChat
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class DataArray implements ArrayAccess
|
class DataArray implements ArrayAccess
|
||||||
{
|
{
|
||||||
@ -50,6 +50,22 @@ class DataArray implements ArrayAccess
|
|||||||
$this->offsetSet($offset, $value);
|
$this->offsetSet($offset, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置配置项值
|
||||||
|
* @param string $offset
|
||||||
|
* @param string|array|null|integer $value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function offsetSet($offset, $value)
|
||||||
|
{
|
||||||
|
if (is_null($offset)) {
|
||||||
|
$this->config[] = $value;
|
||||||
|
} else {
|
||||||
|
$this->config[$offset] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取配置项参数
|
* 获取配置项参数
|
||||||
* @param string|null $offset
|
* @param string|null $offset
|
||||||
@ -60,6 +76,18 @@ class DataArray implements ArrayAccess
|
|||||||
return $this->offsetGet($offset);
|
return $this->offsetGet($offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取配置项参数
|
||||||
|
* @param string|null $offset
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function offsetGet($offset = null)
|
||||||
|
{
|
||||||
|
if (is_null($offset)) return $this->config;
|
||||||
|
return isset($this->config[$offset]) ? $this->config[$offset] : null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合并数据到对象
|
* 合并数据到对象
|
||||||
* @param array $data 需要合并的数据
|
* @param array $data 需要合并的数据
|
||||||
@ -74,22 +102,6 @@ class DataArray implements ArrayAccess
|
|||||||
return array_merge($this->config, $data);
|
return array_merge($this->config, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置配置项值
|
|
||||||
* @param string $offset
|
|
||||||
* @param string|array|null|integer $value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function offsetSet($offset, $value)
|
|
||||||
{
|
|
||||||
if (is_null($offset)) {
|
|
||||||
$this->config[] = $value;
|
|
||||||
} else {
|
|
||||||
$this->config[$offset] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断配置Key是否存在
|
* 判断配置Key是否存在
|
||||||
* @param string $offset
|
* @param string $offset
|
||||||
@ -115,16 +127,4 @@ class DataArray implements ArrayAccess
|
|||||||
unset($this->config[$offset]);
|
unset($this->config[$offset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取配置项参数
|
|
||||||
* @param string|null $offset
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function offsetGet($offset = null)
|
|
||||||
{
|
|
||||||
if (is_null($offset)) return $this->config;
|
|
||||||
return isset($this->config[$offset]) ? $this->config[$offset] : null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -18,7 +18,6 @@ namespace WeChat\Contracts;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误消息处理
|
* 错误消息处理
|
||||||
* Class DataError
|
|
||||||
* @package WeChat\Contracts
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class DataError
|
class DataError
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -18,7 +18,6 @@ namespace WeChat\Contracts;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义CURL文件类
|
* 自定义CURL文件类
|
||||||
* Class MyCurlFile
|
|
||||||
* @package WeChat\Contracts
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class MyCurlFile extends \stdClass
|
class MyCurlFile extends \stdClass
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -48,7 +48,6 @@ use WeChat\Exceptions\LocalCacheException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 网络请求支持
|
* 网络请求支持
|
||||||
* Class Tools
|
|
||||||
* @package WeChat\Contracts
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class Tools
|
class Tools
|
||||||
@ -114,61 +113,6 @@ class Tools
|
|||||||
$GLOBALS['HTTP_RAW_POST_DATA'] = $rawInput;
|
$GLOBALS['HTTP_RAW_POST_DATA'] = $rawInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据文件后缀获取文件类型
|
|
||||||
* @param string|array $ext 文件后缀
|
|
||||||
* @param array $mine 文件后缀MINE信息
|
|
||||||
* @return string
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
public static function getExtMine($ext, $mine = [])
|
|
||||||
{
|
|
||||||
$mines = self::getMines();
|
|
||||||
foreach (is_string($ext) ? explode(',', $ext) : $ext as $e) {
|
|
||||||
$mine[] = isset($mines[strtolower($e)]) ? $mines[strtolower($e)] : 'application/octet-stream';
|
|
||||||
}
|
|
||||||
return join(',', array_unique($mine));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所有文件扩展的类型
|
|
||||||
* @return array
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
private static function getMines()
|
|
||||||
{
|
|
||||||
$mines = self::getCache('all_ext_mine');
|
|
||||||
if (empty($mines)) {
|
|
||||||
$content = file_get_contents('http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types');
|
|
||||||
preg_match_all('#^([^\s]{2,}?)\s+(.+?)$#ism', $content, $matches, PREG_SET_ORDER);
|
|
||||||
foreach ($matches as $match) foreach (explode(" ", $match[2]) as $ext) $mines[$ext] = $match[1];
|
|
||||||
self::setCache('all_ext_mine', $mines);
|
|
||||||
}
|
|
||||||
return $mines;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建CURL文件对象
|
|
||||||
* @param mixed $filename
|
|
||||||
* @param string $mimetype
|
|
||||||
* @param string $postname
|
|
||||||
* @return \CURLFile|string
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
public static function createCurlFile($filename, $mimetype = null, $postname = null)
|
|
||||||
{
|
|
||||||
if (is_string($filename) && file_exists($filename)) {
|
|
||||||
if (is_null($postname)) $postname = basename($filename);
|
|
||||||
if (is_null($mimetype)) $mimetype = self::getExtMine(pathinfo($filename, 4));
|
|
||||||
if (class_exists('CURLFile')) {
|
|
||||||
return new \CURLFile($filename, $mimetype, $postname);
|
|
||||||
} else {
|
|
||||||
return "@{$filename};filename={$postname};type={$mimetype}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数组转XML内容
|
* 数组转XML内容
|
||||||
* @param array $data
|
* @param array $data
|
||||||
@ -202,6 +146,17 @@ class Tools
|
|||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析XML文本内容
|
||||||
|
* @param string $xml
|
||||||
|
* @return array|false
|
||||||
|
*/
|
||||||
|
public static function xml3arr($xml)
|
||||||
|
{
|
||||||
|
$state = xml_parse($parser = xml_parser_create(), $xml, true);
|
||||||
|
return xml_parser_free($parser) && $state ? self::xml2arr($xml) : false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析XML内容到数组
|
* 解析XML内容到数组
|
||||||
* @param string $xml
|
* @param string $xml
|
||||||
@ -219,17 +174,6 @@ class Tools
|
|||||||
return json_decode(json_encode($data), true);
|
return json_decode(json_encode($data), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 解析XML文本内容
|
|
||||||
* @param string $xml
|
|
||||||
* @return array|false
|
|
||||||
*/
|
|
||||||
public static function xml3arr($xml)
|
|
||||||
{
|
|
||||||
$state = xml_parse($parser = xml_parser_create(), $xml, true);
|
|
||||||
return xml_parser_free($parser) && $state ? self::xml2arr($xml) : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数组转xml内容
|
* 数组转xml内容
|
||||||
* @param array $data
|
* @param array $data
|
||||||
@ -260,6 +204,18 @@ class Tools
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emoji原形转换为String
|
||||||
|
* @param string $content
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function emojiEncode($content)
|
||||||
|
{
|
||||||
|
return json_decode(preg_replace_callback("/(\\\u[ed][0-9a-f]{3})/i", function ($string) {
|
||||||
|
return addslashes($string[0]);
|
||||||
|
}, json_encode($content)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数组对象Emoji反解析处理
|
* 数组对象Emoji反解析处理
|
||||||
* @param array $data
|
* @param array $data
|
||||||
@ -279,18 +235,6 @@ class Tools
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Emoji原形转换为String
|
|
||||||
* @param string $content
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function emojiEncode($content)
|
|
||||||
{
|
|
||||||
return json_decode(preg_replace_callback("/(\\\u[ed][0-9a-f]{3})/i", function ($string) {
|
|
||||||
return addslashes($string[0]);
|
|
||||||
}, json_encode($content)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emoji字符串转换为原形
|
* Emoji字符串转换为原形
|
||||||
* @param string $content
|
* @param string $content
|
||||||
@ -335,20 +279,6 @@ class Tools
|
|||||||
return self::doRequest('get', $url, $options);
|
return self::doRequest('get', $url, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 以post访问模拟访问
|
|
||||||
* @param string $url 访问URL
|
|
||||||
* @param array $data POST数据
|
|
||||||
* @param array $options
|
|
||||||
* @return boolean|string
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
public static function post($url, $data = [], $options = [])
|
|
||||||
{
|
|
||||||
$options['data'] = $data;
|
|
||||||
return self::doRequest('post', $url, $options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CURL模拟网络请求
|
* CURL模拟网络请求
|
||||||
* @param string $method 请求方法
|
* @param string $method 请求方法
|
||||||
@ -368,9 +298,14 @@ class Tools
|
|||||||
if (!empty($options['headers'])) {
|
if (!empty($options['headers'])) {
|
||||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $options['headers']);
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $options['headers']);
|
||||||
}
|
}
|
||||||
// POST数据设置
|
// POST/PUT/PATCH/DELETE数据设置
|
||||||
if (strtolower($method) === 'post') {
|
$methodLower = strtolower($method);
|
||||||
curl_setopt($curl, CURLOPT_POST, true);
|
if (in_array($methodLower, ['post', 'put', 'patch', 'delete'])) {
|
||||||
|
if ($methodLower === 'post') {
|
||||||
|
curl_setopt($curl, CURLOPT_POST, true);
|
||||||
|
} else {
|
||||||
|
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, strtoupper($method));
|
||||||
|
}
|
||||||
curl_setopt($curl, CURLOPT_POSTFIELDS, self::_buildHttpData($options['data']));
|
curl_setopt($curl, CURLOPT_POSTFIELDS, self::_buildHttpData($options['data']));
|
||||||
}
|
}
|
||||||
// 证书文件设置
|
// 证书文件设置
|
||||||
@ -384,7 +319,7 @@ class Tools
|
|||||||
curl_setopt($curl, CURLOPT_SSLKEY, $options['ssl_key']);
|
curl_setopt($curl, CURLOPT_SSLKEY, $options['ssl_key']);
|
||||||
} else throw new InvalidArgumentException("Certificate files that do not exist. --- [ssl_key]");
|
} else throw new InvalidArgumentException("Certificate files that do not exist. --- [ssl_key]");
|
||||||
curl_setopt($curl, CURLOPT_URL, $url);
|
curl_setopt($curl, CURLOPT_URL, $url);
|
||||||
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
|
curl_setopt($curl, CURLOPT_TIMEOUT, isset($options['timeout']) ? intval($options['timeout']) : 60);
|
||||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
@ -431,43 +366,58 @@ class Tools
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 写入文件
|
* 创建CURL文件对象
|
||||||
* @param string $name 文件名称
|
* @param mixed $filename
|
||||||
* @param string $content 文件内容
|
* @param string $mimetype
|
||||||
* @return string
|
* @param string $postname
|
||||||
|
* @return \CURLFile|string
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
public static function pushFile($name, $content)
|
public static function createCurlFile($filename, $mimetype = null, $postname = null)
|
||||||
{
|
{
|
||||||
if (is_callable(self::$cache_callable['put'])) {
|
if (is_string($filename) && file_exists($filename)) {
|
||||||
return call_user_func_array(self::$cache_callable['put'], func_get_args());
|
if (is_null($postname)) $postname = basename($filename);
|
||||||
|
if (is_null($mimetype)) $mimetype = self::getExtMine(pathinfo($filename, 4));
|
||||||
|
if (class_exists('CURLFile')) {
|
||||||
|
return new \CURLFile($filename, $mimetype, $postname);
|
||||||
|
} else {
|
||||||
|
return "@{$filename};filename={$postname};type={$mimetype}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$file = self::_getCacheName($name);
|
return $filename;
|
||||||
if (!file_put_contents($file, $content)) {
|
|
||||||
throw new LocalCacheException('local file write error.', '0');
|
|
||||||
}
|
|
||||||
return $file;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存配置与存储
|
* 根据文件后缀获取文件类型
|
||||||
* @param string $name 缓存名称
|
* @param string|array $ext 文件后缀
|
||||||
* @param string $value 缓存内容
|
* @param array $mine 文件后缀MINE信息
|
||||||
* @param int $expired 缓存时间(0表示永久缓存)
|
|
||||||
* @return string
|
* @return string
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
public static function setCache($name, $value = '', $expired = 3600)
|
public static function getExtMine($ext, $mine = [])
|
||||||
{
|
{
|
||||||
if (is_callable(self::$cache_callable['set'])) {
|
$mines = self::getMines();
|
||||||
return call_user_func_array(self::$cache_callable['set'], func_get_args());
|
foreach (is_string($ext) ? explode(',', $ext) : $ext as $e) {
|
||||||
|
$mine[] = isset($mines[strtolower($e)]) ? $mines[strtolower($e)] : 'application/octet-stream';
|
||||||
}
|
}
|
||||||
$file = self::_getCacheName($name);
|
return join(',', array_unique($mine));
|
||||||
$data = ['name' => $name, 'value' => $value, 'expired' => time() + intval($expired)];
|
}
|
||||||
if (!file_put_contents($file, serialize($data))) {
|
|
||||||
throw new LocalCacheException('local cache error.', '0');
|
/**
|
||||||
|
* 获取所有文件扩展的类型
|
||||||
|
* @return array
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
private static function getMines()
|
||||||
|
{
|
||||||
|
$mines = self::getCache('all_ext_mine');
|
||||||
|
if (empty($mines)) {
|
||||||
|
$content = file_get_contents('http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types');
|
||||||
|
preg_match_all('#^([^\s]{2,}?)\s+(.+?)$#ism', $content, $matches, PREG_SET_ORDER);
|
||||||
|
foreach ($matches as $match) foreach (explode(" ", $match[2]) as $ext) $mines[$ext] = $match[1];
|
||||||
|
self::setCache('all_ext_mine', $mines);
|
||||||
}
|
}
|
||||||
return $file;
|
return $mines;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -491,6 +441,23 @@ class Tools
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用缓存目录
|
||||||
|
* @param string $name
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private static function _getCacheName($name)
|
||||||
|
{
|
||||||
|
if (empty(self::$cache_path)) {
|
||||||
|
self::$cache_path = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR;
|
||||||
|
}
|
||||||
|
$cachePath = rtrim((string)self::$cache_path, '/\\') . DIRECTORY_SEPARATOR;
|
||||||
|
if (!file_exists($cachePath)) {
|
||||||
|
mkdir($cachePath, 0755, true);
|
||||||
|
}
|
||||||
|
return $cachePath . $name;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移除缓存文件
|
* 移除缓存文件
|
||||||
* @param string $name 缓存名称
|
* @param string $name 缓存名称
|
||||||
@ -506,17 +473,56 @@ class Tools
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用缓存目录
|
* 缓存配置与存储
|
||||||
* @param string $name
|
* @param string $name 缓存名称
|
||||||
|
* @param string $value 缓存内容
|
||||||
|
* @param int $expired 缓存时间(0表示永久缓存)
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
private static function _getCacheName($name)
|
public static function setCache($name, $value = '', $expired = 3600)
|
||||||
{
|
{
|
||||||
if (empty(self::$cache_path)) {
|
if (is_callable(self::$cache_callable['set'])) {
|
||||||
self::$cache_path = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR;
|
return call_user_func_array(self::$cache_callable['set'], func_get_args());
|
||||||
}
|
}
|
||||||
self::$cache_path = rtrim(self::$cache_path, '/\\') . DIRECTORY_SEPARATOR;
|
$file = self::_getCacheName($name);
|
||||||
file_exists(self::$cache_path) || mkdir(self::$cache_path, 0755, true);
|
$data = ['name' => $name, 'value' => $value, 'expired' => time() + intval($expired)];
|
||||||
return self::$cache_path . $name;
|
if (!file_put_contents($file, serialize($data))) {
|
||||||
|
throw new LocalCacheException('local cache error.', '0');
|
||||||
|
}
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以post访问模拟访问
|
||||||
|
* @param string $url 访问URL
|
||||||
|
* @param array $data POST数据
|
||||||
|
* @param array $options
|
||||||
|
* @return boolean|string
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public static function post($url, $data = [], $options = [])
|
||||||
|
{
|
||||||
|
$options['data'] = $data;
|
||||||
|
return self::doRequest('post', $url, $options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写入文件
|
||||||
|
* @param string $name 文件名称
|
||||||
|
* @param string $content 文件内容
|
||||||
|
* @return string
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public static function pushFile($name, $content)
|
||||||
|
{
|
||||||
|
if (is_callable(self::$cache_callable['put'])) {
|
||||||
|
return call_user_func_array(self::$cache_callable['put'], func_get_args());
|
||||||
|
}
|
||||||
|
$file = self::_getCacheName($name);
|
||||||
|
if (!file_put_contents($file, $content)) {
|
||||||
|
throw new LocalCacheException('local file write error.', '0');
|
||||||
|
}
|
||||||
|
return $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -21,14 +21,13 @@ use WeChat\Contracts\Tools;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 客服消息处理
|
* 客服消息处理
|
||||||
* Class Custom
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Custom extends BasicWeChat
|
class Custom extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 添加客服帐号
|
* 添加客服帐号
|
||||||
* @param string $kf_account 客服账号
|
* @param string $kf_account 客服账号,格式 账号前缀@公众号微信号
|
||||||
* @param string $nickname 客服昵称
|
* @param string $nickname 客服昵称
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
@ -69,7 +68,7 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 邀请绑定客服帐号
|
* 邀请绑定客服帐号
|
||||||
* @param string $kfAccount 完整客服帐号,格式为:帐号前缀@公众号微信号
|
* @param string $kfAccount 客服账号,格式 账号前缀@公众号微信号
|
||||||
* @param string $invite_wx 接收绑定邀请的客服微信号
|
* @param string $invite_wx 接收绑定邀请的客服微信号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
@ -82,7 +81,7 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有客服账号
|
* 获取客服账号列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -94,9 +93,9 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置客服帐号的头像
|
* 设置客服头像
|
||||||
* @param string $kf_account 客户账号
|
* @param string $kf_account 客服账号
|
||||||
* @param string $image 头像文件位置
|
* @param string $image 本地图片路径
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -108,8 +107,8 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客服接口-发消息
|
* 发送客服消息
|
||||||
* @param array $data
|
* @param array $data 消息体(touser, msgtype, content 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -121,9 +120,9 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客服输入状态
|
* 设置客服输入状态
|
||||||
* @param string $openid 普通用户(openid)
|
* @param string $openid 用户 openid
|
||||||
* @param string $command Typing:正在输入,CancelTyping:取消正在输入
|
* @param string $command Typing|CancelTyping
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -135,8 +134,8 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据标签进行群发【订阅号与服务号认证后均可用】
|
* 根据标签群发
|
||||||
* @param array $data
|
* @param array $data 群发参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -148,8 +147,8 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据OpenID列表群发【订阅号不可用,服务号认证后可用】
|
* 根据 OpenID 列表群发
|
||||||
* @param array $data
|
* @param array $data 群发参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -161,9 +160,9 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除群发【订阅号与服务号认证后均可用】
|
* 删除群发
|
||||||
* @param integer $msg_id 发送出去的消息ID
|
* @param int $msg_id 群发消息ID
|
||||||
* @param null|integer $article_idx 要删除的文章在图文消息中的位置,第一篇编号为1,该字段不填或填0会删除全部文章
|
* @param null|int $article_idx 图文位置,0 删除全部
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -177,8 +176,8 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预览接口【订阅号与服务号认证后均可用】
|
* 群发预览
|
||||||
* @param array $data
|
* @param array $data 预览参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -190,8 +189,8 @@ class Custom extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询群发消息发送状态【订阅号与服务号认证后均可用】
|
* 查询群发状态
|
||||||
* @param integer $msgId 群发消息后返回的消息id
|
* @param int $msgId 群发消息ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -216,7 +215,7 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置群发速度
|
* 设置群发速度
|
||||||
* @param integer $speed 群发速度的级别
|
* @param int $speed 速度级别
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信草稿箱管理
|
* 微信草稿箱管理
|
||||||
* Class Draft
|
|
||||||
* @author taoxin
|
* @author taoxin
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
@ -28,8 +27,8 @@ class Draft extends BasicWeChat
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 新建草稿
|
* 新建草稿
|
||||||
* @param $articles
|
* @param array $articles 图文数组 articles
|
||||||
* @return array
|
* @return array 草稿 media_id
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -41,9 +40,9 @@ class Draft extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取草稿
|
* 获取草稿
|
||||||
* @param string $mediaId
|
* @param string $mediaId 草稿 media_id
|
||||||
* @param string $outType 返回处理函数
|
* @param string $outType 可选回调处理
|
||||||
* @return array
|
* @return array 草稿内容
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -55,7 +54,7 @@ class Draft extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除草稿
|
* 删除草稿
|
||||||
* @param string $mediaId
|
* @param string $mediaId 草稿 media_id
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -68,7 +67,7 @@ class Draft extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增图文素材
|
* 新增图文素材
|
||||||
* @param array $data 文件名称
|
* @param array $data 图文 articles
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -81,9 +80,9 @@ class Draft extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改草稿
|
* 修改草稿
|
||||||
* @param string $media_id 要修改的图文消息的id
|
* @param string $media_id 草稿 media_id
|
||||||
* @param int $index 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0
|
* @param int $index 文章序号(0 开始)
|
||||||
* @param $articles
|
* @param array $articles 文章内容
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -109,9 +108,9 @@ class Draft extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取草稿列表
|
* 获取草稿列表
|
||||||
* @param int $offset 从全部素材的该偏移位置开始返回,0表示从第一个素材返回
|
* @param int $offset 起始位置
|
||||||
* @param int $count 返回素材的数量,取值在1到20之间
|
* @param int $count 拉取数量 1-20
|
||||||
* @param int $noContent 1 表示不返回 content 字段,0 表示正常返回,默认为 0
|
* @param int $noContent 1 不返回 content,0 返回
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -18,8 +18,7 @@ namespace WeChat\Exceptions;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口参数异常
|
* 接口参数异常
|
||||||
* Class InvalidArgumentException
|
* @package WeChat\Exceptions
|
||||||
* @package WeChat
|
|
||||||
*/
|
*/
|
||||||
class InvalidArgumentException extends \InvalidArgumentException
|
class InvalidArgumentException extends \InvalidArgumentException
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -18,8 +18,7 @@ namespace WeChat\Exceptions;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密解密异常
|
* 加密解密异常
|
||||||
* Class InvalidResponseException
|
* @package WeChat\Exceptions
|
||||||
* @package WeChat
|
|
||||||
*/
|
*/
|
||||||
class InvalidDecryptException extends \Exception
|
class InvalidDecryptException extends \Exception
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -18,7 +18,6 @@ namespace WeChat\Exceptions;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载类异常
|
* 加载类异常
|
||||||
* Class InvalidInstanceException
|
|
||||||
* @package WeChat\Exceptions
|
* @package WeChat\Exceptions
|
||||||
*/
|
*/
|
||||||
class InvalidInstanceException extends \Exception
|
class InvalidInstanceException extends \Exception
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -18,8 +18,7 @@ namespace WeChat\Exceptions;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回异常
|
* 返回异常
|
||||||
* Class InvalidResponseException
|
* @package WeChat\Exceptions
|
||||||
* @package WeChat
|
|
||||||
*/
|
*/
|
||||||
class InvalidResponseException extends \Exception
|
class InvalidResponseException extends \Exception
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -18,8 +18,7 @@ namespace WeChat\Exceptions;
|
|||||||
|
|
||||||
/***
|
/***
|
||||||
* 本地缓存异常
|
* 本地缓存异常
|
||||||
* Class LocalCacheException
|
* @package WeChat\Exceptions
|
||||||
* @package WeChat
|
|
||||||
*/
|
*/
|
||||||
class LocalCacheException extends \Exception
|
class LocalCacheException extends \Exception
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,17 +20,15 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布能力
|
* 发布能力
|
||||||
* Class Freepublish
|
|
||||||
* @author taoxin
|
* @author taoxin
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Freepublish extends BasicWeChat
|
class Freepublish extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 发布接口
|
* 提交发布
|
||||||
* 开发者需要先将图文素材以草稿的形式保存(见“草稿箱/新建草稿”,如需从已保存的草稿中选择,见“草稿箱/获取草稿列表”)
|
* @param string $mediaId 草稿 media_id
|
||||||
* @param mixed $mediaId 选择要发布的草稿的media_id
|
* @return array 含 publish_id
|
||||||
* @return array
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -41,8 +39,8 @@ class Freepublish extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布状态轮询接口
|
* 查询发布状态
|
||||||
* @param mixed $publishId
|
* @param string $publishId 发布任务 ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -54,10 +52,9 @@ class Freepublish extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除发布
|
* 删除已发布文章
|
||||||
* 发布成功之后,随时可以通过该接口删除。此操作不可逆,请谨慎操作。
|
* @param string $articleId 发布返回的 article_id
|
||||||
* @param mixed $articleId 成功发布时返回的 article_id
|
* @param int $index 图文序号,1 开始,0 删除全部
|
||||||
* @param int $index 要删除的文章在图文消息中的位置,第一篇编号为1,该字段不填或填0会删除全部文章
|
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -69,8 +66,8 @@ class Freepublish extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过 article_id 获取已发布文章
|
* 获取已发布文章
|
||||||
* @param mixed $articleId 要获取的草稿的article_id
|
* @param string $articleId article_id
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -82,10 +79,10 @@ class Freepublish extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取成功发布列表
|
* 获取已发布列表
|
||||||
* @param int $offset 从全部素材的该偏移位置开始返回,0表示从第一个素材返回
|
* @param int $offset 起始偏移
|
||||||
* @param int $count 返回素材的数量,取值在1到20之间
|
* @param int $count 数量 1-20
|
||||||
* @param int $noContent 1 表示不返回 content 字段,0 表示正常返回,默认为 0
|
* @param int $noContent 1 不返回 content
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口调用频次限制
|
* 接口调用频次限制
|
||||||
* Class Limit
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Limit extends BasicWeChat
|
class Limit extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号调用或第三方平台帮公众号调用对公众号的所有api调用(包括第三方帮其调用)次数进行清零
|
* 清空公众号 API 调用次数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -40,8 +39,8 @@ class Limit extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 网络检测
|
* 网络检测
|
||||||
* @param string $action 执行的检测动作
|
* @param string $action ping|dns|all
|
||||||
* @param string $operator 指定平台从某个运营商进行检测
|
* @param string $operator DEFAULT|CT|CU|CM
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -53,7 +52,7 @@ class Limit extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取微信服务器IP地址
|
* 获取微信服务器 IP
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -22,16 +22,15 @@ use WeChat\Exceptions\InvalidResponseException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信素材管理
|
* 微信素材管理
|
||||||
* Class Media
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Media extends BasicWeChat
|
class Media extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 新增临时素材
|
* 新增临时素材
|
||||||
* @param string $filename 文件名称
|
* @param string $filename 本地文件路径
|
||||||
* @param string $type 媒体文件类型(image|voice|video|thumb)
|
* @param string $type 媒体类型 image|voice|video|thumb
|
||||||
* @return array
|
* @return array 上传结果(media_id 等)
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -46,8 +45,8 @@ class Media extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取临时素材
|
* 获取临时素材
|
||||||
* @param string $media_id
|
* @param string $media_id 媒体 ID
|
||||||
* @param string $outType 返回处理函数
|
* @param string $outType 可选:回调处理或 'url' 仅返回 URL
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -69,8 +68,8 @@ class Media extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增图文素材
|
* 新增永久图文素材
|
||||||
* @param array $data 文件名称
|
* @param array $data 图文列表 articles
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -83,8 +82,8 @@ class Media extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新图文素材
|
* 更新图文素材
|
||||||
* @param string $media_id 要修改的图文消息的id
|
* @param string $media_id 图文 media_id
|
||||||
* @param int $index 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0
|
* @param int $index 文章位置(0 开始)
|
||||||
* @param array $news 文章内容
|
* @param array $news 文章内容
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -97,9 +96,9 @@ class Media extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传图文消息内的图片获取URL
|
* 上传图文消息内的图片,获取 URL
|
||||||
* @param mixed $filename
|
* @param string $filename 本地文件
|
||||||
* @return array
|
* @return array 含 url
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -111,9 +110,9 @@ class Media extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增其他类型永久素材
|
* 新增其他类型永久素材
|
||||||
* @param mixed $filename 文件名称
|
* @param string $filename 本地文件路径
|
||||||
* @param string $type 媒体文件类型(image|voice|video|thumb)
|
* @param string $type 媒体类型 image|voice|video|thumb
|
||||||
* @param array $description 包含素材的描述信息
|
* @param array $description 视频描述等
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -129,8 +128,8 @@ class Media extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取永久素材
|
* 获取永久素材
|
||||||
* @param string $media_id
|
* @param string $media_id 媒体 ID
|
||||||
* @param null|string $outType 输出类型
|
* @param null|string $outType 回调处理或 'url' 返回地址
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -153,7 +152,7 @@ class Media extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除永久素材
|
* 删除永久素材
|
||||||
* @param string $mediaId
|
* @param string $mediaId 媒体 ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -178,9 +177,9 @@ class Media extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取素材列表
|
* 获取素材列表
|
||||||
* @param string $type
|
* @param string $type image|voice|video|news
|
||||||
* @param int $offset
|
* @param int $offset 起始位置
|
||||||
* @param int $count
|
* @param int $count 拉取数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,15 +20,14 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信菜单管理
|
* 微信菜单管理
|
||||||
* Class Menu
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Menu extends BasicWeChat
|
class Menu extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义菜单查询接口
|
* 查询自定义菜单接口
|
||||||
* @return array
|
* @return array 菜单配置信息
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -39,8 +38,8 @@ class Menu extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义菜单删除接口
|
* 删除自定义菜单接口
|
||||||
* @return array
|
* @return array 操作结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -51,9 +50,9 @@ class Menu extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义菜单创建
|
* 创建自定义菜单接口
|
||||||
* @param array $data
|
* @param array $data 菜单配置(button数组,最多3个一级菜单,每个一级菜单最多5个二级菜单)
|
||||||
* @return array
|
* @return array 操作结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -64,9 +63,9 @@ class Menu extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建个性化菜单
|
* 创建个性化菜单接口
|
||||||
* @param array $data
|
* @param array $data 菜单配置(button数组和matchrule匹配规则)
|
||||||
* @return array
|
* @return array 返回menuid
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -77,9 +76,9 @@ class Menu extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除个性化菜单
|
* 删除个性化菜单接口
|
||||||
* @param string $menuid
|
* @param string $menuid 菜单ID
|
||||||
* @return array
|
* @return array 操作结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -90,9 +89,9 @@ class Menu extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试个性化菜单匹配结果
|
* 测试个性化菜单匹配结果接口
|
||||||
* @param string $openid
|
* @param string $openid 用户openid
|
||||||
* @return array
|
* @return array 该用户匹配的菜单配置
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,18 +20,17 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信网页授权
|
* 微信网页授权
|
||||||
* Class Oauth
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Oauth extends BasicWeChat
|
class Oauth extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Oauth 授权跳转接口
|
* 构造网页授权跳转链接
|
||||||
* @param string $redirect_url 授权回跳地址
|
* @param string $redirect_url 回调地址
|
||||||
* @param string $state 为重定向后会带上state参数(填写a-zA-Z0-9的参数值,最多128字节)
|
* @param string $state 自定义状态(<=128 字节)
|
||||||
* @param string $scope 授权类类型(可选值snsapi_base|snsapi_userinfo)
|
* @param string $scope snsapi_base|snsapi_userinfo
|
||||||
* @return string
|
* @return string 跳转 URL
|
||||||
*/
|
*/
|
||||||
public function getOauthRedirect($redirect_url, $state = '', $scope = 'snsapi_base')
|
public function getOauthRedirect($redirect_url, $state = '', $scope = 'snsapi_base')
|
||||||
{
|
{
|
||||||
@ -41,8 +40,8 @@ class Oauth extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过 code 获取 AccessToken 和 openid
|
* 通过 code 换取 access_token/refresh_token/openid
|
||||||
* @param string $code 授权Code值,不传则取GET参数
|
* @param string $code 授权 code,不传则取 GET 参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -57,8 +56,8 @@ class Oauth extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新AccessToken并续期
|
* 刷新网页授权 access_token
|
||||||
* @param string $refresh_token
|
* @param string $refresh_token 刷新 token
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -71,9 +70,9 @@ class Oauth extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检验授权凭证(access_token)是否有效
|
* 校验网页授权 access_token 是否有效
|
||||||
* @param string $accessToken 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同
|
* @param string $accessToken 网页授权 access_token
|
||||||
* @param string $openid 用户的唯一标识
|
* @param string $openid 用户 openid
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -85,10 +84,10 @@ class Oauth extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取用户信息(需scope为 snsapi_userinfo)
|
* 拉取用户信息(snsapi_userinfo)
|
||||||
* @param string $accessToken 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同
|
* @param string $accessToken 网页授权 access_token
|
||||||
* @param string $openid 用户的唯一标识
|
* @param string $openid 用户 openid
|
||||||
* @param string $lang 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
|
* @param string $lang zh_CN|zh_TW|en
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -24,8 +24,7 @@ use WePay\Transfers;
|
|||||||
use WePay\TransfersBank;
|
use WePay\TransfersBank;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付商户
|
* 微信支付商户聚合入口(V2)
|
||||||
* Class Pay
|
|
||||||
* @package WeChat\Contracts
|
* @package WeChat\Contracts
|
||||||
*/
|
*/
|
||||||
class Pay extends BasicWePay
|
class Pay extends BasicWePay
|
||||||
@ -33,8 +32,8 @@ class Pay extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一下单
|
* 统一下单
|
||||||
* @param array $options
|
* @param array $options 下单参数(out_trade_no, body, total_fee, notify_url, trade_type 等)
|
||||||
* @return array
|
* @return array 预支付信息
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -44,8 +43,8 @@ class Pay extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷卡支付
|
* 刷卡支付(被扫)
|
||||||
* @param array $options
|
* @param array $options 支付参数(auth_code, out_trade_no, total_fee 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -56,9 +55,9 @@ class Pay extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建JsApi及H5支付参数
|
* 生成 JSAPI/H5 支付参数
|
||||||
* @param string $prepay_id 统一下单预支付码
|
* @param string $prepay_id 统一下单返回的 prepay_id
|
||||||
* @return array
|
* @return array 前端调起参数
|
||||||
*/
|
*/
|
||||||
public function createParamsForJsApi($prepay_id)
|
public function createParamsForJsApi($prepay_id)
|
||||||
{
|
{
|
||||||
@ -66,9 +65,9 @@ class Pay extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取APP支付参数
|
* 生成 APP 支付参数
|
||||||
* @param string $prepay_id 统一下单预支付码
|
* @param string $prepay_id 统一下单返回的 prepay_id
|
||||||
* @return array
|
* @return array APP 支付参数
|
||||||
*/
|
*/
|
||||||
public function createParamsForApp($prepay_id)
|
public function createParamsForApp($prepay_id)
|
||||||
{
|
{
|
||||||
@ -76,8 +75,8 @@ class Pay extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取支付规则二维码
|
* 生成 Native 支付二维码 URL
|
||||||
* @param string $product_id 商户定义的商品id 或者订单号
|
* @param string $product_id 商品 ID 或订单号
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function createParamsForRuleQrc($product_id)
|
public function createParamsForRuleQrc($product_id)
|
||||||
@ -87,8 +86,8 @@ class Pay extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单
|
* 查询订单
|
||||||
* @param array $options
|
* @param array $options 查询参数(transaction_id 或 out_trade_no)
|
||||||
* @return array
|
* @return array 订单详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -111,7 +110,7 @@ class Pay extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请退款
|
* 申请退款
|
||||||
* @param array $options
|
* @param array $options 退款参数(out_trade_no/transaction_id,out_refund_no,total_fee,refund_fee 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -123,7 +122,7 @@ class Pay extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询退款
|
* 查询退款
|
||||||
* @param array $options
|
* @param array $options 查询参数(transaction_id/out_trade_no/out_refund_no/refund_id 四选一)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -134,8 +133,8 @@ class Pay extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 交易保障
|
* 交易保障上报
|
||||||
* @param array $options
|
* @param array $options 上报参数(interface_url, execute_time, return_code 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -146,9 +145,9 @@ class Pay extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 授权码查询openid
|
* 授权码查询 openid
|
||||||
* @param string $authCode 扫码支付授权码,设备读取用户微信中的条码或者二维码信息
|
* @param string $authCode 扫码支付授权码
|
||||||
* @return array
|
* @return array 含 openid
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -159,8 +158,8 @@ class Pay extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载对账单
|
* 下载对账单
|
||||||
* @param array $options 静音参数
|
* @param array $options 账单参数(bill_date, bill_type 等)
|
||||||
* @param null|string $outType 输出类型
|
* @param null|string $outType 输出处理回调,为 null 返回原始内容
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -171,8 +170,8 @@ class Pay extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取订单评价数据
|
* 拉取订单评价数据(需证书)
|
||||||
* @param array $options
|
* @param array $options 查询参数(bill_date, offset, limit 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -184,7 +183,7 @@ class Pay extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业付款到零钱
|
* 企业付款到零钱
|
||||||
* @param array $options
|
* @param array $options 付款参数(partner_trade_no, openid, amount, desc 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -196,7 +195,7 @@ class Pay extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询企业付款到零钱
|
* 查询企业付款到零钱
|
||||||
* @param string $partner_trade_no 商户调用企业付款API时使用的商户订单号
|
* @param string $partner_trade_no 商户付款单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -208,7 +207,7 @@ class Pay extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业付款到银行卡
|
* 企业付款到银行卡
|
||||||
* @param array $options
|
* @param array $options 付款参数(partner_trade_no, enc_bank_no, enc_true_name, bank_code, amount 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -220,8 +219,8 @@ class Pay extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户企业付款到银行卡操作进行结果查询
|
* 查询企业付款到银行卡结果
|
||||||
* @param string $partner_trade_no 商户订单号,需保持唯一
|
* @param string $partner_trade_no 商户付款单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 商店管理
|
* 商店管理
|
||||||
* Class Product
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Product extends BasicWeChat
|
class Product extends BasicWeChat
|
||||||
@ -29,7 +28,7 @@ class Product extends BasicWeChat
|
|||||||
* 提交审核/取消发布商品
|
* 提交审核/取消发布商品
|
||||||
* @param string $keystandard 商品编码标准
|
* @param string $keystandard 商品编码标准
|
||||||
* @param string $keystr 商品编码内容
|
* @param string $keystr 商品编码内容
|
||||||
* @param string $status 设置发布状态。on为提交审核,off为取消发布
|
* @param string $status on 提交审核 | off 取消发布
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -43,8 +42,8 @@ class Product extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置测试人员白名单
|
* 设置测试人员白名单
|
||||||
* @param array $openids 测试人员的openid列表
|
* @param array $openids openid 列表
|
||||||
* @param array $usernames 测试人员的微信号列表
|
* @param array $usernames 微信号列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -57,10 +56,10 @@ class Product extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品二维码
|
* 获取商品二维码
|
||||||
* @param string $keystandard 商品编码标准
|
* @param string $keystandard 编码标准
|
||||||
* @param string $keystr 商品编码内容
|
* @param string $keystr 编码内容
|
||||||
* @param integer $qrcode_size 二维码的尺寸(整型),数值代表边长像素数,不填写默认值为100
|
* @param int $qrcode_size 边长像素,默认100
|
||||||
* @param array $extinfo 由商户自定义传入,建议仅使用大小写字母、数字及-_().*这6个常用字符
|
* @param array $extinfo 自定义扩展
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -91,10 +90,10 @@ class Product extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量查询商品信息
|
* 批量查询商品信息
|
||||||
* @param integer $offset 批量查询的起始位置,从0开始,包含该起始位置
|
* @param int $offset 起始位置
|
||||||
* @param integer $limit 批量查询的数量
|
* @param int $limit 数量
|
||||||
* @param null|string $status 支持按状态拉取。on为发布状态,off为未发布状态,check为审核中状态,reject为审核未通过状态,all为所有状态
|
* @param null|string $status on|off|check|reject|all
|
||||||
* @param string $keystr 支持按部分编码内容拉取。填写该参数后,可将编码内容中包含所传参数的商品信息拉出。类似关键词搜索
|
* @param string $keystr 模糊编码过滤
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -110,7 +109,7 @@ class Product extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品信息
|
* 更新商品信息
|
||||||
* @param array $data
|
* @param array $data 商品数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -136,7 +135,7 @@ class Product extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查wxticket参数
|
* 检查 wxticket 参数
|
||||||
* @param string $ticket
|
* @param string $ticket
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -152,7 +151,7 @@ class Product extends BasicWeChat
|
|||||||
* 清除扫码记录
|
* 清除扫码记录
|
||||||
* @param string $keystandard 商品编码标准
|
* @param string $keystandard 商品编码标准
|
||||||
* @param string $keystr 商品编码内容
|
* @param string $keystr 商品编码内容
|
||||||
* @param string $extinfo 调用“获取商品二维码接口”时传入的extinfo,为标识参数
|
* @param string $extinfo 获取二维码时的 extinfo
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -5,7 +5,6 @@ namespace WeChat\Prpcrypt;
|
|||||||
/**
|
/**
|
||||||
* 仅用作类内部使用
|
* 仅用作类内部使用
|
||||||
* 不用于官方API接口的errCode码
|
* 不用于官方API接口的errCode码
|
||||||
* Class ErrorCode
|
|
||||||
*/
|
*/
|
||||||
class ErrorCode
|
class ErrorCode
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,7 +4,6 @@ namespace WeChat\Prpcrypt;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* PKCS7算法 - 加解密
|
* PKCS7算法 - 加解密
|
||||||
* Class PKCS7Encoder
|
|
||||||
*/
|
*/
|
||||||
class PKCS7Encoder
|
class PKCS7Encoder
|
||||||
{
|
{
|
||||||
|
|||||||
@ -16,7 +16,6 @@ namespace WeChat\Prpcrypt;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号消息 - 加解密
|
* 公众号消息 - 加解密
|
||||||
* Class Prpcrypt
|
|
||||||
*/
|
*/
|
||||||
class Prpcrypt
|
class Prpcrypt
|
||||||
{
|
{
|
||||||
@ -52,6 +51,21 @@ class Prpcrypt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机生成16位字符串
|
||||||
|
* @param string $str
|
||||||
|
* @return string 生成的字符串
|
||||||
|
*/
|
||||||
|
function getRandomStr($str = "")
|
||||||
|
{
|
||||||
|
$str_pol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
|
||||||
|
$max = strlen($str_pol) - 1;
|
||||||
|
for ($i = 0; $i < 16; $i++) {
|
||||||
|
$str .= $str_pol[mt_rand(0, $max)];
|
||||||
|
}
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对密文进行解密
|
* 对密文进行解密
|
||||||
* @param string $encrypted 需要解密的密文
|
* @param string $encrypted 需要解密的密文
|
||||||
@ -80,19 +94,4 @@ class Prpcrypt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 随机生成16位字符串
|
|
||||||
* @param string $str
|
|
||||||
* @return string 生成的字符串
|
|
||||||
*/
|
|
||||||
function getRandomStr($str = "")
|
|
||||||
{
|
|
||||||
$str_pol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
|
|
||||||
$max = strlen($str_pol) - 1;
|
|
||||||
for ($i = 0; $i < 16; $i++) {
|
|
||||||
$str .= $str_pol[mt_rand(0, $max)];
|
|
||||||
}
|
|
||||||
return $str;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,17 +20,16 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 二维码管理
|
* 二维码管理
|
||||||
* Class Qrcode
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Qrcode extends BasicWeChat
|
class Qrcode extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建二维码ticket
|
* 创建二维码 ticket
|
||||||
* @param string|integer $scene 场景
|
* @param string|int $scene 场景值(字符串或数字)
|
||||||
* @param int $expire_seconds 有效时间
|
* @param int $expire_seconds 过期时间,0 表示永久
|
||||||
* @return array
|
* @return array 含 ticket、url
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -52,9 +51,9 @@ class Qrcode extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ticket换取二维码
|
* 通过 ticket 换取二维码 URL
|
||||||
* @param string $ticket 获取的二维码ticket,凭借此ticket可以在有效时间内换取二维码。
|
* @param string $ticket 二维码 ticket
|
||||||
* @return string
|
* @return string 图片 URL
|
||||||
*/
|
*/
|
||||||
public function url($ticket)
|
public function url($ticket)
|
||||||
{
|
{
|
||||||
@ -62,8 +61,8 @@ class Qrcode extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 长链接转短链接接口
|
* 长链接转短链接
|
||||||
* @param string $longUrl 需要转换的长链接
|
* @param string $longUrl 长链接
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,15 +20,14 @@ use WeChat\Contracts\BasicPushEvent;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号推送管理
|
* 公众号推送管理
|
||||||
* Class Receive
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Receive extends BasicPushEvent
|
class Receive extends BasicPushEvent
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转发多客服消息
|
* 转发到多客服
|
||||||
* @param string $account
|
* @param string $account 可选客服账号
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function transferCustomerService($account = '')
|
public function transferCustomerService($account = '')
|
||||||
@ -61,8 +60,8 @@ class Receive extends BasicPushEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置回复图文
|
* 设置图文消息
|
||||||
* @param array $newsData
|
* @param array $newsData Articles 列表
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function news($newsData = [])
|
public function news($newsData = [])
|
||||||
@ -80,7 +79,7 @@ class Receive extends BasicPushEvent
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置图片消息
|
* 设置图片消息
|
||||||
* @param string $mediaId 图片媒体ID
|
* @param string $mediaId 图片 media_id
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function image($mediaId = '')
|
public function image($mediaId = '')
|
||||||
@ -96,8 +95,8 @@ class Receive extends BasicPushEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置语音回复消息
|
* 设置语音消息
|
||||||
* @param string $mediaid 语音媒体ID
|
* @param string $mediaid 语音 media_id
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function voice($mediaid = '')
|
public function voice($mediaid = '')
|
||||||
@ -113,10 +112,10 @@ class Receive extends BasicPushEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置视频回复消息
|
* 设置视频消息
|
||||||
* @param string $mediaid 视频媒体ID
|
* @param string $mediaid 视频 media_id
|
||||||
* @param string $title 视频标题
|
* @param string $title 标题
|
||||||
* @param string $description 视频描述
|
* @param string $description 描述
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function video($mediaid = '', $title = '', $description = '')
|
public function video($mediaid = '', $title = '', $description = '')
|
||||||
@ -136,12 +135,12 @@ class Receive extends BasicPushEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置音乐回复消息
|
* 设置音乐消息
|
||||||
* @param string $title 音乐标题
|
* @param string $title 标题
|
||||||
* @param string $desc 音乐描述
|
* @param string $desc 描述
|
||||||
* @param string $musicurl 音乐地址
|
* @param string $musicurl 音乐链接
|
||||||
* @param string $hgmusicurl 高清音乐地址
|
* @param string $hgmusicurl 高清链接
|
||||||
* @param string $thumbmediaid 音乐图片缩略图的媒体id(可选)
|
* @param string $thumbmediaid 缩略图 media_id
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function music($title, $desc, $musicurl, $hgmusicurl = '', $thumbmediaid = '')
|
public function music($title, $desc, $musicurl, $hgmusicurl = '', $thumbmediaid = '')
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫一扫接入管理
|
* 扫一扫接入管理
|
||||||
* Class Scan
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Scan extends BasicWeChat
|
class Scan extends BasicWeChat
|
||||||
@ -39,7 +38,7 @@ class Scan extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建商品
|
* 创建商品
|
||||||
* @param array $data
|
* @param array $data 商品数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -51,10 +50,10 @@ class Scan extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品发布
|
* 商品发布/取消
|
||||||
* @param string $keystandard 商品编码标准
|
* @param string $keystandard 商品编码标准
|
||||||
* @param string $keystr 商品编码内容
|
* @param string $keystr 商品编码内容
|
||||||
* @param string $status 设置发布状态。on为提交审核,off为取消发布
|
* @param string $status on 提交审核 | off 取消
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -68,8 +67,8 @@ class Scan extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置测试人员白名单
|
* 设置测试人员白名单
|
||||||
* @param array $openids 测试人员的openid列表
|
* @param array $openids openid 列表
|
||||||
* @param array $usernames 测试人员的微信号列表
|
* @param array $usernames 微信号列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -82,10 +81,10 @@ class Scan extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品二维码
|
* 获取商品二维码
|
||||||
* @param string $keystandard
|
* @param string $keystandard 编码标准
|
||||||
* @param string $keystr
|
* @param string $keystr 编码内容
|
||||||
* @param null|string $extinfo
|
* @param null|string $extinfo 自定义标识
|
||||||
* @param integer $qrcode_size
|
* @param int $qrcode_size 边长像素
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -114,10 +113,10 @@ class Scan extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量查询商品信息
|
* 批量查询商品信息
|
||||||
* @param integer $offset 批量查询的起始位置,从0开始,包含该起始位置。
|
* @param int $offset 起始位置
|
||||||
* @param integer $limit 批量查询的数量。
|
* @param int $limit 数量
|
||||||
* @param string $status 支持按状态拉取。on为发布状态,off为未发布状态,check为审核中状态,reject为审核未通过状态,all为所有状态。
|
* @param string $status on|off|check|reject|all
|
||||||
* @param string $keystr 支持按部分编码内容拉取。填写该参数后,可将编码内容中包含所传参数的商品信息拉出。类似关键词搜索。
|
* @param string $keystr 关键词过滤
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -133,7 +132,7 @@ class Scan extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品信息
|
* 更新商品信息
|
||||||
* @param array $data
|
* @param array $data 商品数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -159,7 +158,7 @@ class Scan extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查wxticket参数
|
* 检查 wxticket 参数
|
||||||
* @param string $ticket
|
* @param string $ticket
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -175,7 +174,7 @@ class Scan extends BasicWeChat
|
|||||||
* 清除扫码记录
|
* 清除扫码记录
|
||||||
* @param string $keystandard 商品编码标准
|
* @param string $keystandard 商品编码标准
|
||||||
* @param string $keystr 商品编码内容
|
* @param string $keystr 商品编码内容
|
||||||
* @param string $extinfo 调用“获取商品二维码接口”时传入的extinfo,为标识参数
|
* @param string $extinfo 二维码接口时的 extinfo
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -22,7 +22,6 @@ use WeChat\Exceptions\InvalidResponseException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信前端支持
|
* 微信前端支持
|
||||||
* Class Script
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Script extends BasicWeChat
|
class Script extends BasicWeChat
|
||||||
@ -42,37 +41,11 @@ class Script extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取JSAPI_TICKET接口
|
* 获取 JSAPI 签名
|
||||||
* @param string $type TICKET类型(wx_card|jsapi)
|
* @param string $url 当前页面 URL(不含 #)
|
||||||
* @param string $appid 强制指定有效APPID
|
* @param string $appid 可选指定 appid
|
||||||
* @return string
|
* @param string $ticket 可选指定 ticket
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @param array $jsApiList 需注入的 API 列表
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
public function getTicket($type = 'jsapi', $appid = null)
|
|
||||||
{
|
|
||||||
is_null($appid) && $appid = $this->config->get('appid');
|
|
||||||
$cache_name = "{$appid}_ticket_{$type}";
|
|
||||||
$ticket = Tools::getCache($cache_name);
|
|
||||||
if (empty($ticket)) {
|
|
||||||
$url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type={$type}";
|
|
||||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
|
||||||
$result = $this->httpGetForJson($url);
|
|
||||||
if (empty($result['ticket'])) {
|
|
||||||
throw new InvalidResponseException('Invalid Resoponse Ticket.', '0');
|
|
||||||
}
|
|
||||||
$ticket = $result['ticket'];
|
|
||||||
Tools::setCache($cache_name, $ticket, 7000);
|
|
||||||
}
|
|
||||||
return $ticket;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取JsApi使用签名
|
|
||||||
* @param string $url 网页的URL
|
|
||||||
* @param string $appid 用于多个appid时使用(可空)
|
|
||||||
* @param string $ticket 强制指定ticket
|
|
||||||
* @param array $jsApiList 需初始化的 jsApiList
|
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -100,12 +73,38 @@ class Script extends BasicWeChat
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 JSAPI_TICKET
|
||||||
|
* @param string $type jsapi|wx_card
|
||||||
|
* @param string $appid 可选指定 appid
|
||||||
|
* @return string ticket
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public function getTicket($type = 'jsapi', $appid = null)
|
||||||
|
{
|
||||||
|
is_null($appid) && $appid = $this->config->get('appid');
|
||||||
|
$cache_name = "{$appid}_ticket_{$type}";
|
||||||
|
$ticket = Tools::getCache($cache_name);
|
||||||
|
if (empty($ticket)) {
|
||||||
|
$url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type={$type}";
|
||||||
|
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||||
|
$result = $this->httpGetForJson($url);
|
||||||
|
if (empty($result['ticket'])) {
|
||||||
|
throw new InvalidResponseException('Invalid Resoponse Ticket.', '0');
|
||||||
|
}
|
||||||
|
$ticket = $result['ticket'];
|
||||||
|
Tools::setCache($cache_name, $ticket, 7000);
|
||||||
|
}
|
||||||
|
return $ticket;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据生成签名
|
* 数据生成签名
|
||||||
* @param array $data 签名数组
|
* @param array $data 待签名数据
|
||||||
* @param string $method 签名方法
|
* @param string $method 签名方法
|
||||||
* @param array $params 签名参数
|
* @param array $params 额外参数
|
||||||
* @return bool|string 签名值
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
protected function getSignature($data, $method = "sha1", $params = [])
|
protected function getSignature($data, $method = "sha1", $params = [])
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -21,14 +21,13 @@ use WeChat\Contracts\Tools;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 揺一揺周边
|
* 揺一揺周边
|
||||||
* Class Shake
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Shake extends BasicWeChat
|
class Shake extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 申请开通功能
|
* 申请开通摇一摇
|
||||||
* @param array $data
|
* @param array $data 资质信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -52,11 +51,11 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请设备ID
|
* 申请设备 ID
|
||||||
* @param string $quantity 申请的设备ID的数量,单次新增设备超过500个,需走人工审核流程
|
* @param string $quantity 数量(>500 走人工审核)
|
||||||
* @param string $apply_reason 申请理由,不超过100个汉字或200个英文字母
|
* @param string $apply_reason 理由
|
||||||
* @param null|string $comment 备注,不超过15个汉字或30个英文字母
|
* @param null|string $comment 备注
|
||||||
* @param null|string $poi_id 设备关联的门店ID,关联门店后,在门店1KM的范围内有优先摇出信息的机会。
|
* @param null|string $poi_id 门店ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -71,8 +70,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备ID申请审核状态
|
* 查询设备 ID 申请状态
|
||||||
* @param integer $applyId 批次ID,申请设备ID时所返回的批次ID
|
* @param int $applyId 批次ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -85,7 +84,7 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑设备信息
|
* 编辑设备信息
|
||||||
* @param array $data
|
* @param array $data 设备参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -97,8 +96,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置设备与门店的关联关系
|
* 设备绑定门店
|
||||||
* @param array $data
|
* @param array $data 绑定参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -111,7 +110,7 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备列表
|
* 查询设备列表
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -123,8 +122,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面管理
|
* 创建页面
|
||||||
* @param array $data
|
* @param array $data 页面参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -136,8 +135,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑页面信息
|
* 编辑页面
|
||||||
* @param array $data
|
* @param array $data 页面参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -150,7 +149,7 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询页面列表
|
* 查询页面列表
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -163,7 +162,7 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除页面
|
* 删除页面
|
||||||
* @param integer $pageId 指定页面的id
|
* @param int $pageId 页面ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -176,8 +175,8 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传图片素材
|
* 上传图片素材
|
||||||
* @param string $filename 图片名字
|
* @param string $filename 图片路径
|
||||||
* @param string $type Icon:摇一摇页面展示的icon图;License:申请开通摇一摇周边功能时需上传的资质文件;若不传type,则默认type=icon
|
* @param string $type icon|license
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -189,8 +188,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置设备与页面的关联关系
|
* 配置设备与页面关联
|
||||||
* @param array $data
|
* @param array $data 关联参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -202,8 +201,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备与页面的关联关系
|
* 查询设备与页面关联
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -215,8 +214,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 以设备为维度的数据统计接口
|
* 设备维度数据统计
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -228,9 +227,9 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量查询设备统计数据接口
|
* 批量查询设备统计
|
||||||
* @param integer $date 指定查询日期时间戳,单位为秒
|
* @param int $date 日期时间戳(秒)
|
||||||
* @param integer $pageIndex 指定查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页
|
* @param int $pageIndex 页码
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -242,10 +241,10 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 以页面为维度的数据统计接口
|
* 页面维度数据统计
|
||||||
* @param integer $pageId 指定页面的设备ID
|
* @param int $pageId 页面ID
|
||||||
* @param integer $beginDate 起始日期时间戳,最长时间跨度为30天,单位为秒
|
* @param int $beginDate 起始时间戳
|
||||||
* @param integer $endDate 结束日期时间戳,最长时间跨度为30天,单位为秒
|
* @param int $endDate 结束时间戳
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -258,8 +257,8 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑分组信息
|
* 编辑分组信息
|
||||||
* @param integer $groupId 分组唯一标识,全局唯一
|
* @param int $groupId 分组ID
|
||||||
* @param string $groupName 分组名称,不超过100汉字或200个英文字母
|
* @param string $groupName 分组名称
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -272,7 +271,7 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除分组
|
* 删除分组
|
||||||
* @param integer $groupId 分组唯一标识,全局唯一
|
* @param int $groupId 分组ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -285,8 +284,8 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询分组列表
|
* 查询分组列表
|
||||||
* @param integer $begin 分组列表的起始索引值
|
* @param int $begin 起始索引
|
||||||
* @param integer $count 待查询的分组数量,不能超过1000个
|
* @param int $count 数量(<=1000)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -300,9 +299,9 @@ class Shake extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询分组详情
|
* 查询分组详情
|
||||||
* @param integer $group_id 分组唯一标识,全局唯一
|
* @param int $group_id 分组ID
|
||||||
* @param integer $begin 分组里设备的起始索引值
|
* @param int $begin 设备起始索引
|
||||||
* @param integer $count 待查询的分组里设备的数量,不能超过1000个
|
* @param int $count 数量(<=1000)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -314,8 +313,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加设备到分组
|
* 分组添加设备
|
||||||
* @param array $data
|
* @param array $data 设备参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -327,8 +326,8 @@ class Shake extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从分组中移除设备
|
* 分组移除设备
|
||||||
* @param array $data
|
* @param array $data 设备参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,13 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户标签管理
|
* 用户标签管理
|
||||||
* Class Tags
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Tags extends BasicWeChat
|
class Tags extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 获取粉丝标签列表
|
* 获取标签列表
|
||||||
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -37,8 +37,8 @@ class Tags extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建粉丝标签
|
* 创建标签
|
||||||
* @param string $name
|
* @param string $name 标签名称
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -50,8 +50,8 @@ class Tags extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新粉丝标签
|
* 更新标签
|
||||||
* @param integer $id 标签ID
|
* @param int $id 标签ID
|
||||||
* @param string $name 标签名称
|
* @param string $name 标签名称
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
@ -64,8 +64,8 @@ class Tags extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除粉丝标签
|
* 删除标签
|
||||||
* @param int $tagId
|
* @param int $tagId 标签ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -78,8 +78,8 @@ class Tags extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量为用户打标签
|
* 批量为用户打标签
|
||||||
* @param array $openids
|
* @param array $openids openid 列表
|
||||||
* @param integer $tagId
|
* @param int $tagId 标签ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -91,9 +91,9 @@ class Tags extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量为用户取消标签
|
* 批量取消用户标签
|
||||||
* @param array $openids
|
* @param array $openids openid 列表
|
||||||
* @param integer $tagId
|
* @param int $tagId 标签ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -105,8 +105,8 @@ class Tags extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户身上的标签列表
|
* 获取用户标签列表
|
||||||
* @param string $openid
|
* @param string $openid 用户 openid
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,15 +20,14 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 模板消息
|
* 模板消息
|
||||||
* Class Template
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Template extends BasicWeChat
|
class Template extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 设置所属行业
|
* 设置模板消息所属行业
|
||||||
* @param string $industryId1 公众号模板消息所属行业编号
|
* @param string $industryId1 行业编号
|
||||||
* @param string $industryId2 公众号模板消息所属行业编号
|
* @param string $industryId2 行业编号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -40,7 +39,7 @@ class Template extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取设置的行业信息
|
* 获取已设置的行业信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -52,9 +51,9 @@ class Template extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得模板ID
|
* 领取模板 ID
|
||||||
* @param string $templateIdShort 板库中模板的编号,有“TM**”和“OPENTMTM**”等形式
|
* @param string $templateIdShort 模板编号(如 TM** 或 OPENTMTM**)
|
||||||
* @param array $keywordNameList 选用的类目模板的关键词
|
* @param array $keywordNameList 选用关键词
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -66,7 +65,7 @@ class Template extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取模板列表
|
* 获取私有模板列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -78,8 +77,8 @@ class Template extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除模板ID
|
* 删除模板
|
||||||
* @param string $tplId 公众帐号下模板消息ID
|
* @param string $tplId 模板 ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -92,7 +91,7 @@ class Template extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送模板消息
|
* 发送模板消息
|
||||||
* @param array $data
|
* @param array $data 消息内容(touser, template_id, data 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,17 +20,16 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信粉丝管理
|
* 微信粉丝管理
|
||||||
* Class User
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class User extends BasicWeChat
|
class User extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置用户备注名
|
* 设置用户备注名接口
|
||||||
* @param string $openid
|
* @param string $openid 用户openid
|
||||||
* @param string $remark
|
* @param string $remark 备注名(长度不超过30字符)
|
||||||
* @return array
|
* @return array 操作结果
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -41,10 +40,10 @@ class User extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户基本信息(包括UnionID机制)
|
* 获取用户基本信息接口(包括UnionID)
|
||||||
* @param string $openid
|
* @param string $openid 用户openid
|
||||||
* @param string $lang
|
* @param string $lang 返回国家地区语言版本(zh_CN, zh_TW, en)
|
||||||
* @return array
|
* @return array 用户信息(nickname, headimgurl, sex, province, city, country, unionid等)
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -55,10 +54,10 @@ class User extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量获取用户基本信息
|
* 批量获取用户基本信息接口
|
||||||
* @param array $openids
|
* @param array $openids 用户openid列表(最多100个)
|
||||||
* @param string $lang
|
* @param string $lang 返回国家地区语言版本
|
||||||
* @return array
|
* @return array 用户信息列表
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -73,9 +72,9 @@ class User extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户列表
|
* 获取用户列表接口
|
||||||
* @param string $next_openid
|
* @param string $next_openid 第一个拉取的openid,不填默认从头开始拉取
|
||||||
* @return array
|
* @return array 用户列表(total, count, data.openid, next_openid)
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -86,10 +85,10 @@ class User extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取标签下粉丝列表
|
* 获取标签下粉丝列表接口
|
||||||
* @param integer $tagid 标签ID
|
* @param integer $tagid 标签ID
|
||||||
* @param string $nextOpenid 第一个拉取的OPENID
|
* @param string $nextOpenid 第一个拉取的openid,不填默认从头开始拉取
|
||||||
* @return array
|
* @return array 粉丝列表(count, data.openid, next_openid)
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -100,9 +99,9 @@ class User extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取公众号的黑名单列表
|
* 获取公众号黑名单列表接口
|
||||||
* @param string $beginOpenid
|
* @param string $beginOpenid 第一个拉取的openid,不填默认从头开始拉取
|
||||||
* @return array
|
* @return array 黑名单列表(total, count, data.openid, next_openid)
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -113,9 +112,9 @@ class User extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量拉黑用户
|
* 批量拉黑用户接口
|
||||||
* @param array $openids
|
* @param array $openids 用户openid列表(最多20个)
|
||||||
* @return array
|
* @return array 操作结果
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -126,9 +125,9 @@ class User extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量取消拉黑用户
|
* 批量取消拉黑用户接口
|
||||||
* @param array $openids
|
* @param array $openids 用户openid列表(最多20个)
|
||||||
* @return array
|
* @return array 操作结果
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 门店 WIFI 管理
|
* 门店 WIFI 管理
|
||||||
* Class Wifi
|
|
||||||
* @package WeChat
|
* @package WeChat
|
||||||
*/
|
*/
|
||||||
class Wifi extends BasicWeChat
|
class Wifi extends BasicWeChat
|
||||||
@ -28,8 +27,8 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 Wi-Fi 门店列表
|
* 获取 Wi-Fi 门店列表
|
||||||
* @param integer $pageindex 分页下标,默认从1开始
|
* @param int $pageindex 页码(从1开始)
|
||||||
* @param integer $pagesize 每页的个数,默认10个,最大20个
|
* @param int $pagesize 每页数量(<=20)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -42,8 +41,8 @@ class Wifi extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询门店Wi-Fi信息
|
* 查询门店 Wi-Fi 信息
|
||||||
* @param integer $shop_id 门店ID
|
* @param int $shop_id 门店ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -56,11 +55,11 @@ class Wifi extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改门店网络信息
|
* 修改门店 Wi-Fi
|
||||||
* @param integer $shop_id 门店ID
|
* @param int $shop_id 门店ID
|
||||||
* @param string $old_ssid 旧的无线网络设备的ssid
|
* @param string $old_ssid 原 SSID
|
||||||
* @param string $ssid 新的无线网络设备的ssid
|
* @param string $ssid 新 SSID
|
||||||
* @param string $password 无线网络设备的密码(可选)
|
* @param string $password 可选密码
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -75,8 +74,8 @@ class Wifi extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空门店网络及设备
|
* 清空门店网络与设备
|
||||||
* @param integer $shop_id
|
* @param int $shop_id 门店ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -90,9 +89,9 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加密码型设备
|
* 添加密码型设备
|
||||||
* @param integer $shop_id 门店ID
|
* @param int $shop_id 门店ID
|
||||||
* @param string $ssid 无线网络设备的ssid
|
* @param string $ssid SSID
|
||||||
* @param null|string $password 无线网络设备的密码
|
* @param null|string $password 密码
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -106,10 +105,10 @@ class Wifi extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加portal型设备
|
* 添加 portal 型设备
|
||||||
* @param integer $shop_id 门店ID
|
* @param int $shop_id 门店ID
|
||||||
* @param string $ssid 无线网络设备的ssid
|
* @param string $ssid SSID
|
||||||
* @param bool $reset 重置secretkey,false-不重置,true-重置,默认为false
|
* @param bool $reset 是否重置 secretkey
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -124,9 +123,9 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备
|
* 查询设备
|
||||||
* @param null|integer $shop_id 根据门店id查询
|
* @param int|null $shop_id 门店ID
|
||||||
* @param null|integer $pageindex 分页下标,默认从1开始
|
* @param int|null $pageindex 页码
|
||||||
* @param null|integer $pagesize 每页的个数,默认10个,最大20个
|
* @param int|null $pagesize 数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -144,7 +143,7 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除设备
|
* 删除设备
|
||||||
* @param string $bssid 需要删除的无线网络设备无线mac地址,格式冒号分隔,字符长度17个,并且字母小写,例如:00:1f:7a:ad:5c:a8
|
* @param string $bssid 设备 MAC,冒号分隔小写
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -158,9 +157,9 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取物料二维码
|
* 获取物料二维码
|
||||||
* @param integer $shop_id 门店ID
|
* @param int $shop_id 门店ID
|
||||||
* @param string $ssid 已添加到门店下的无线网络名称
|
* @param string $ssid SSID
|
||||||
* @param integer $img_id 物料样式编号:0-纯二维码,可用于自由设计宣传材料;1-二维码物料,155mm×215mm(宽×高),可直接张贴
|
* @param int $img_id 物料样式 0|1
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -174,9 +173,9 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置商家主页
|
* 设置商家主页
|
||||||
* @param integer $shop_id 门店ID
|
* @param int $shop_id 门店ID
|
||||||
* @param integer $template_id 模板ID,0-默认模板,1-自定义url
|
* @param int $template_id 0 默认 | 1 自定义链接
|
||||||
* @param null|string $url 自定义链接,当template_id为1时必填
|
* @param null|string $url 自定义链接(template_id=1 必填)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -192,7 +191,7 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询商家主页
|
* 查询商家主页
|
||||||
* @param integer $shop_id 查询的门店id
|
* @param int $shop_id 门店ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -206,8 +205,8 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置微信首页欢迎语
|
* 设置微信首页欢迎语
|
||||||
* @param integer $shop_id 门店ID
|
* @param int $shop_id 门店ID
|
||||||
* @param integer $bar_type 微信首页欢迎语的文本内容:0--欢迎光临+公众号名称;1--欢迎光临+门店名称;2--已连接+公众号名称+WiFi;3--已连接+门店名称+Wi-Fi。
|
* @param int $bar_type 0|1|2|3
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -221,8 +220,8 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置连网完成页
|
* 设置连网完成页
|
||||||
* @param integer $shop_id 门店ID
|
* @param int $shop_id 门店ID
|
||||||
* @param string $finishpage_url 连网完成页URL
|
* @param string $finishpage_url 完成页 URL
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -236,9 +235,9 @@ class Wifi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Wi-Fi 数据统计
|
* Wi-Fi 数据统计
|
||||||
* @param string $begin_date 起始日期时间,格式yyyy-mm-dd,最长时间跨度为30天
|
* @param string $begin_date 开始日期 yyyy-mm-dd
|
||||||
* @param string $end_date 结束日期时间戳,格式yyyy-mm-dd,最长时间跨度为30天
|
* @param string $end_date 结束日期 yyyy-mm-dd
|
||||||
* @param integer $shop_id 按门店ID搜索,-1为总统计
|
* @param int $shop_id 门店ID,-1 总统计
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -251,12 +250,12 @@ class Wifi extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置门店卡券投放信息
|
* 设置门店卡券投放
|
||||||
* @param integer $shop_id 门店ID,可设置为0,表示所有门店
|
* @param int $shop_id 门店ID,0 表示全部
|
||||||
* @param integer $card_id 卡券ID
|
* @param int $card_id 卡券ID
|
||||||
* @param string $card_describe 卡券描述,不能超过18个字符
|
* @param string $card_describe 描述(<=18 字符)
|
||||||
* @param string $start_time 卡券投放开始时间(单位是秒)
|
* @param string $start_time 开始时间戳
|
||||||
* @param string $end_time 卡券投放结束时间(单位是秒) 注:不能超过卡券的有效期时间
|
* @param string $end_time 结束时间戳
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
@ -270,8 +269,8 @@ class Wifi extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询门店卡券投放信息
|
* 查询门店卡券投放
|
||||||
* @param integer $shop_id 门店ID,可设置为0,表示所有门店
|
* @param int $shop_id 门店ID,0 表示全部
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exceptions\InvalidResponseException
|
* @throws Exceptions\InvalidResponseException
|
||||||
* @throws Exceptions\LocalCacheException
|
* @throws Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -24,50 +24,17 @@ use WXBizDataCrypt;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据加密处理
|
* 小程序数据加解密
|
||||||
* Class Crypt
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Crypt extends BasicWeChat
|
class Crypt extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据签名校验
|
* 通过 code 解密用户信息
|
||||||
* @param string $iv
|
* @param string $code 登录凭证
|
||||||
* @param string $sessionKey
|
* @param string $iv 初始向量
|
||||||
* @param string $encryptedData
|
* @param string $encryptedData 加密数据
|
||||||
* @return bool|array
|
|
||||||
*/
|
|
||||||
public function decode($iv, $sessionKey, $encryptedData)
|
|
||||||
{
|
|
||||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'crypt' . DIRECTORY_SEPARATOR . 'wxBizDataCrypt.php';
|
|
||||||
$pc = new WXBizDataCrypt($this->config->get('appid'), $sessionKey);
|
|
||||||
$errCode = $pc->decryptData($encryptedData, $iv, $data);
|
|
||||||
if ($errCode == 0) {
|
|
||||||
return json_decode($data, true);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录凭证校验
|
|
||||||
* @param string $code 登录时获取的 code
|
|
||||||
* @return array
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
public function session($code)
|
|
||||||
{
|
|
||||||
$appid = $this->config->get('appid');
|
|
||||||
$secret = $this->config->get('appsecret');
|
|
||||||
$url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appid}&secret={$secret}&js_code={$code}&grant_type=authorization_code";
|
|
||||||
return json_decode(Tools::get($url), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 换取用户信息
|
|
||||||
* @param string $code 用户登录凭证(有效期五分钟)
|
|
||||||
* @param string $iv 加密算法的初始向量
|
|
||||||
* @param string $encryptedData 加密数据( encryptedData )
|
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -87,8 +54,41 @@ class Crypt extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过授权码换取手机号
|
* code 换取 session_key
|
||||||
* @param string $code
|
* @param string $code 登录 code
|
||||||
|
* @return array
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public function session($code)
|
||||||
|
{
|
||||||
|
$appid = $this->config->get('appid');
|
||||||
|
$secret = $this->config->get('appsecret');
|
||||||
|
$url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appid}&secret={$secret}&js_code={$code}&grant_type=authorization_code";
|
||||||
|
return json_decode(Tools::get($url), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解密数据
|
||||||
|
* @param string $iv 初始向量
|
||||||
|
* @param string $sessionKey 会话密钥
|
||||||
|
* @param string $encryptedData 加密数据
|
||||||
|
* @return bool|array
|
||||||
|
*/
|
||||||
|
public function decode($iv, $sessionKey, $encryptedData)
|
||||||
|
{
|
||||||
|
require_once __DIR__ . DIRECTORY_SEPARATOR . 'crypt' . DIRECTORY_SEPARATOR . 'wxBizDataCrypt.php';
|
||||||
|
$pc = new WXBizDataCrypt($this->config->get('appid'), $sessionKey);
|
||||||
|
$data = '';
|
||||||
|
$errCode = $pc->decryptData($encryptedData, $iv, $data);
|
||||||
|
if ($errCode == 0) {
|
||||||
|
return json_decode($data, true);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 code 获取手机号
|
||||||
|
* @param string $code 授权码
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -101,11 +101,11 @@ class Crypt extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户支付完成后,获取该用户的 UnionId
|
* 支付后获取用户 UnionId
|
||||||
* @param string $openid 支付用户唯一标识
|
* @param string $openid 用户 openid
|
||||||
* @param null|string $transaction_id 微信支付订单号
|
* @param null|string $transaction_id 微信支付订单号
|
||||||
* @param null|string $mch_id 微信支付分配的商户号,和商户订单号配合使用
|
* @param null|string $mch_id 商户号
|
||||||
* @param null|string $out_trade_no 微信支付商户订单号,和商户号配合使用
|
* @param null|string $out_trade_no 商户订单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -113,9 +113,9 @@ class Crypt extends BasicWeChat
|
|||||||
public function getPaidUnionId($openid, $transaction_id = null, $mch_id = null, $out_trade_no = null)
|
public function getPaidUnionId($openid, $transaction_id = null, $mch_id = null, $out_trade_no = null)
|
||||||
{
|
{
|
||||||
$url = "https://api.weixin.qq.com/wxa/getpaidunionid?access_token=ACCESS_TOKEN&openid={$openid}";
|
$url = "https://api.weixin.qq.com/wxa/getpaidunionid?access_token=ACCESS_TOKEN&openid={$openid}";
|
||||||
if (is_null($mch_id)) $url .= "&mch_id={$mch_id}";
|
if (!is_null($mch_id)) $url .= "&mch_id={$mch_id}";
|
||||||
if (is_null($out_trade_no)) $url .= "&out_trade_no={$out_trade_no}";
|
if (!is_null($out_trade_no)) $url .= "&out_trade_no={$out_trade_no}";
|
||||||
if (is_null($transaction_id)) $url .= "&transaction_id={$transaction_id}";
|
if (!is_null($transaction_id)) $url .= "&transaction_id={$transaction_id}";
|
||||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||||
return $this->callGetApi($url);
|
return $this->callGetApi($url);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序客服服务
|
* 小程序客服服务
|
||||||
* Class Custom
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Custom extends BasicWeChat
|
class Custom extends BasicWeChat
|
||||||
@ -28,7 +27,7 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建商户
|
* 创建商户
|
||||||
* @param array $data
|
* @param array $data 商户资料
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -41,7 +40,7 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商户信息
|
* 更新商户信息
|
||||||
* @param array $data
|
* @param array $data 商户资料
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -54,8 +53,8 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取单个商户信息
|
* 查询单个商户
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -68,8 +67,8 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取多个商户信息
|
* 查询商户列表
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -82,7 +81,7 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送客服消息
|
* 发送客服消息
|
||||||
* @param array $data
|
* @param array $data 消息体(touser, msgtype, content 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -95,7 +94,7 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 客服输入状态
|
* 客服输入状态
|
||||||
* @param array $data
|
* @param array $data 输入状态参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -108,8 +107,8 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取客服基本信息
|
* 获取客服列表
|
||||||
* @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id
|
* @param string $business_id 子商户 business_id,普通小程序可为空
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -126,7 +125,7 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取在线客服列表
|
* 获取在线客服列表
|
||||||
* @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id
|
* @param string $business_id 子商户 business_id,普通小程序可为空
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -142,8 +141,8 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客服输入状态
|
* 新增客服账号
|
||||||
* @param array $data
|
* @param array $data 账号参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -157,8 +156,8 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除客服账号
|
* 删除客服账号
|
||||||
* @param string $kf_openid 客服openid
|
* @param string $kf_openid 客服 openid
|
||||||
* @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id
|
* @param string $business_id 子商户 business_id,可为空
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -174,8 +173,8 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置客服管理员
|
* 设置客服管理员
|
||||||
* @param string $kf_openid 客服openid
|
* @param string $kf_openid 客服 openid
|
||||||
* @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id
|
* @param string $business_id 子商户 business_id,可为空
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -192,8 +191,8 @@ class Custom extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消客服管理员
|
* 取消客服管理员
|
||||||
* @param string $kf_openid 客服openid
|
* @param string $kf_openid 客服 openid
|
||||||
* @param string $business_id 客服子商户的business_id,对于普通小程序客服不需要填business_id
|
* @param string $business_id 子商户 business_id,可为空
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,15 +20,14 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序即时配送
|
* 小程序即时配送
|
||||||
* Class Delivery
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Delivery extends BasicWeChat
|
class Delivery extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异常件退回商家商家确认收货接口
|
* 异常件退回确认收货
|
||||||
* @param array $data
|
* @param array $data 请求参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -40,8 +39,8 @@ class Delivery extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下配送单接口
|
* 下配送单
|
||||||
* @param array $data
|
* @param array $data 订单信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -53,8 +52,8 @@ class Delivery extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 可以对待接单状态的订单增加小费
|
* 待接单订单加小费
|
||||||
* @param array $data
|
* @param array $data 订单与小费信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -66,8 +65,8 @@ class Delivery extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消配送单接口
|
* 取消配送单
|
||||||
* @param array $data
|
* @param array $data 订单信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -79,8 +78,8 @@ class Delivery extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取已支持的配送公司列表接口
|
* 获取配送公司列表
|
||||||
* @param array $data
|
* @param array $data 请求参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -93,7 +92,7 @@ class Delivery extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取已绑定账号
|
* 拉取已绑定账号
|
||||||
* @param array $data
|
* @param array $data 请求参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -105,8 +104,8 @@ class Delivery extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取配送单信息
|
* 查询配送单
|
||||||
* @param array $data
|
* @param array $data 订单信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -118,8 +117,8 @@ class Delivery extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模拟配送公司更新配送单状态
|
* 模拟更新配送单状态
|
||||||
* @param array $data
|
* @param array $data 模拟参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -131,8 +130,8 @@ class Delivery extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预下配送单接口
|
* 预下单
|
||||||
* @param array $data
|
* @param array $data 订单信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -144,8 +143,8 @@ class Delivery extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预取消配送单接口
|
* 预取消配送单
|
||||||
* @param array $data
|
* @param array $data 订单信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -158,7 +157,7 @@ class Delivery extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 重新下单
|
* 重新下单
|
||||||
* @param array $data
|
* @param array $data 订单信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
136
WeMini/Guide.php
136
WeMini/Guide.php
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序导购助手
|
* 小程序导购助手
|
||||||
* Class Guide
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Guide extends BasicWeChat
|
class Guide extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 服务号添加导购
|
* 添加导购
|
||||||
* @param array $data
|
* @param array $data 导购账号信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,8 +38,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务号删除导购
|
* 删除导购
|
||||||
* @param array $data
|
* @param array $data 导购账号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -52,8 +51,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务号获取导购信息
|
* 获取导购信息
|
||||||
* @param array $data
|
* @param array $data 导购账号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -65,7 +64,7 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取服务号的敏感词信息与自动回复信息
|
* 获取敏感词与自动回复配置
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -77,9 +76,9 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务号拉取导购列表
|
* 拉取导购列表
|
||||||
* @param integer $page
|
* @param int $page 页码
|
||||||
* @param integer $num
|
* @param int $num 数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -92,7 +91,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取导购聊天记录
|
* 获取导购聊天记录
|
||||||
* @param array $data
|
* @param array $data 查询条件
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -104,8 +103,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取导购快捷回复信息
|
* 获取导购快捷回复
|
||||||
* @param array $data
|
* @param array $data 导购信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -118,7 +117,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成导购二维码
|
* 生成导购二维码
|
||||||
* @param array $data
|
* @param array $data 导购信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -130,7 +129,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $data
|
* 推送小程序路径菜单
|
||||||
|
* @param array $data 请求参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -142,8 +142,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 为服务号设置敏感词与自动回复
|
* 设置敏感词与自动回复
|
||||||
* @param array $data
|
* @param array $data 配置数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -155,8 +155,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置导购快捷回复信息
|
* 设置导购快捷回复
|
||||||
* @param array $data
|
* @param array $data 快捷回复数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -168,8 +168,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新导购昵称或者头像
|
* 更新导购昵称或头像
|
||||||
* @param array $data
|
* @param array $data 导购信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -181,8 +181,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加展示标签信息
|
* 添加展示标签
|
||||||
* @param array $data
|
* @param array $data 标签数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -195,7 +195,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 为粉丝添加可查询标签
|
* 为粉丝添加可查询标签
|
||||||
* @param array $data
|
* @param array $data 标签数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -208,7 +208,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加标签可选值
|
* 添加标签可选值
|
||||||
* @param array $data
|
* @param array $data 选项数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -221,7 +221,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除粉丝标签
|
* 删除粉丝标签
|
||||||
* @param array $data
|
* @param array $data 标签数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -233,8 +233,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询展示标签信息
|
* 查询展示标签
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -247,7 +247,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询粉丝标签
|
* 查询粉丝标签
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -259,7 +259,7 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询标签可选值信息
|
* 查询标签可选值
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -271,8 +271,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新建可查询标签类型,支持新建4类可查询标签
|
* 新建可查询标签类型
|
||||||
* @param array $data
|
* @param array $data 标签数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -284,8 +284,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据标签值筛选粉丝
|
* 标签筛选粉丝
|
||||||
* @param array $data
|
* @param array $data 标签查询条件
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -298,8 +298,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 为服务号导购添加粉丝
|
* 导购添加粉丝
|
||||||
* @param array $data
|
* @param array $data 绑定数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -312,8 +312,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除导购的粉丝
|
* 删除导购粉丝
|
||||||
* @param array $data
|
* @param array $data 解绑数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -326,8 +326,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询某一个粉丝与导购的绑定关系
|
* 查询粉丝绑定关系
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -340,8 +340,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过粉丝信息查询该粉丝与导购的绑定关系
|
* 通过粉丝查询绑定关系
|
||||||
* @param string $openid
|
* @param string $openid 粉丝 openid
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -354,8 +354,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取导购的粉丝列表
|
* 拉取导购粉丝列表
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -368,8 +368,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将粉丝从一个导购迁移到另外一个导购下
|
* 粉丝迁移导购
|
||||||
* @param array $data
|
* @param array $data 迁移数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -383,7 +383,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新粉丝昵称
|
* 更新粉丝昵称
|
||||||
* @param array $data
|
* @param array $data 昵称数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -396,8 +396,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除小程序卡片素材
|
* 删除卡片素材
|
||||||
* @param array $data
|
* @param array $data 素材信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -411,7 +411,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除图片素材
|
* 删除图片素材
|
||||||
* @param array $data
|
* @param array $data 素材信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -425,7 +425,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除文字素材
|
* 删除文字素材
|
||||||
* @param array $data
|
* @param array $data 素材信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -438,8 +438,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小程序卡片素材信息
|
* 获取卡片素材
|
||||||
* @param integer $type
|
* @param int $type 类型
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -452,10 +452,10 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取图片素材信息
|
* 获取图片素材
|
||||||
* @param integer $type 操作类型
|
* @param int $type 类型
|
||||||
* @param integer $start 分页查询,起始位置
|
* @param int $start 起始
|
||||||
* @param integer $num 分页查询,查询个数
|
* @param int $num 数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -468,10 +468,10 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文字素材信息
|
* 获取文字素材
|
||||||
* @param integer $type 操作类型
|
* @param int $type 类型
|
||||||
* @param integer $start 分页查询,起始位置
|
* @param int $start 起始
|
||||||
* @param integer $num 分页查询,查询个数
|
* @param int $num 数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -484,8 +484,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加小程序卡片素材
|
* 添加卡片素材
|
||||||
* @param array $data
|
* @param array $data 素材数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -499,7 +499,7 @@ class Guide extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加图片素材
|
* 添加图片素材
|
||||||
* @param array $data
|
* @param array $data 素材数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -512,8 +512,8 @@ class Guide extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 为服务号添加文字素材
|
* 添加文字素材
|
||||||
* @param array $data
|
* @param array $data 素材数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,16 +20,15 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序图像处理
|
* 小程序图像处理
|
||||||
* Class Image
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Image extends BasicWeChat
|
class Image extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的图片智能裁剪能力
|
* 图片智能裁剪
|
||||||
* @param string $img_url 要检测的图片 url,传这个则不用传 img 参数。
|
* @param string $img_url 图片 URL(与 img 二选一)
|
||||||
* @param string $img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用穿 img_url
|
* @param string $img form-data 媒体文件(与 img_url 二选一)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -41,9 +40,9 @@ class Image extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的条码/二维码识别的API
|
* 条码/二维码识别
|
||||||
* @param string $img_url 要检测的图片 url,传这个则不用传 img 参数。
|
* @param string $img_url 图片 URL(与 img 二选一)
|
||||||
* @param string $img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用穿 img_url
|
* @param string $img form-data 媒体文件(与 img_url 二选一)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -55,9 +54,9 @@ class Image extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的图片高清化能力
|
* 图片高清化
|
||||||
* @param string $img_url 要检测的图片 url,传这个则不用传 img 参数
|
* @param string $img_url 图片 URL(与 img 二选一)
|
||||||
* @param string $img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用穿 img_url
|
* @param string $img form-data 媒体文件(与 img_url 二选一)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序运费险
|
* 小程序运费险
|
||||||
* Class Insurance
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Insurance extends BasicWeChat
|
class Insurance extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开通无忧退货接口
|
* 开通无忧退货
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,7 +38,7 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询开通状态接口
|
* 查询开通状态
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -51,8 +50,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 投保接口(发货时投保)
|
* 发货投保
|
||||||
* @param array $data
|
* @param array $data 投保数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -64,8 +63,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 理赔接口 (收到用户退货后再触发)
|
* 退货理赔
|
||||||
* @param array $data
|
* @param array $data 理赔数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -77,8 +76,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请充值订单号接口 (支持自定义金额)
|
* 申请充值订单号
|
||||||
* @param array $data
|
* @param array $data 充值请求
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -90,8 +89,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请支付接口
|
* 申请支付
|
||||||
* @param array $data
|
* @param array $data 支付数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -103,8 +102,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取充值订单信息接口
|
* 拉取充值订单
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -117,8 +116,8 @@ class Insurance extends BasicWeChat
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款接口
|
* 保险退款
|
||||||
* @param array $data
|
* @param array $data 退款参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -130,8 +129,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取摘要接口 (查询当前保费、投保单量、理赔单量、账号余额等信息)
|
* 获取保费摘要
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -143,8 +142,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取保单信息接口
|
* 拉取保单信息
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -156,8 +155,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置告警余额接口
|
* 设置告警余额
|
||||||
* @param array $data
|
* @param array $data 配置参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -170,7 +169,7 @@ class Insurance extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建退货 ID
|
* 创建退货 ID
|
||||||
* @param array $data
|
* @param array $data 退货参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -183,7 +182,7 @@ class Insurance extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询退货 ID 状态
|
* 查询退货 ID 状态
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -195,8 +194,8 @@ class Insurance extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查解绑退货 ID
|
* 解绑退货 ID
|
||||||
* @param array $data
|
* @param array $data 解绑参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
125
WeMini/Live.php
125
WeMini/Live.php
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,15 +19,14 @@ namespace WeMini;
|
|||||||
use WeChat\Contracts\BasicWeChat;
|
use WeChat\Contracts\BasicWeChat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序直播接口
|
* 小程序直播
|
||||||
* Class Live
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Live extends BasicWeChat
|
class Live extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 创建直播间
|
* 创建直播间
|
||||||
* @param array $data
|
* @param array $data 房间信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -40,8 +39,8 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取直播房间列表
|
* 获取直播房间列表
|
||||||
* @param integer $start 起始拉取房间
|
* @param int $start 起始
|
||||||
* @param integer $limit 每次拉取的个数上限
|
* @param int $limit 数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -53,8 +52,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取回放源视频
|
* 获取直播/回放信息
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -67,7 +66,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 直播间导入商品
|
* 直播间导入商品
|
||||||
* @param array $data
|
* @param array $data 商品列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -80,7 +79,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品添加并提审
|
* 商品添加并提审
|
||||||
* @param array $data
|
* @param array $data 商品信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -92,8 +91,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品撤回审核
|
* 撤回商品审核
|
||||||
* @param array $data
|
* @param array $data 商品信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -105,8 +104,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重新提交审核
|
* 重新提交商品审核
|
||||||
* @param array $data
|
* @param array $data 商品信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -119,7 +118,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品
|
* 删除商品
|
||||||
* @param array $data
|
* @param array $data 商品信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -132,7 +131,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品
|
* 更新商品
|
||||||
* @param array $data
|
* @param array $data 商品信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -145,7 +144,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品状态
|
* 获取商品状态
|
||||||
* @param array $data
|
* @param array $data 商品ID列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -158,9 +157,9 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品列表
|
* 获取商品列表
|
||||||
* @param integer $offset 分页条数起点
|
* @param int $offset 起始
|
||||||
* @param integer $status 商品状态,0:未审核。1:审核中,2:审核通过,3:审核驳回
|
* @param int $status 0 未审 |1 审核中 |2 通过 |3 驳回
|
||||||
* @param integer $limit 分页大小,默认30,不超过100
|
* @param int $limit 数量(<=100)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -173,7 +172,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除直播间
|
* 删除直播间
|
||||||
* @param array $data
|
* @param array $data 房间信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -186,7 +185,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑直播间
|
* 编辑直播间
|
||||||
* @param array $data
|
* @param array $data 房间信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -198,8 +197,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取直播间推流地址
|
* 获取推流地址
|
||||||
* @param string $roomId
|
* @param string $roomId 房间ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -211,9 +210,9 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取直播间分享二维码
|
* 获取直播间分享码
|
||||||
* @param string $roomId
|
* @param string $roomId 房间ID
|
||||||
* @param string $params
|
* @param string $params 自定义参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -225,8 +224,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加管理直播间小助手
|
* 添加小助手
|
||||||
* @param array $data
|
* @param array $data 助手信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -238,8 +237,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改管理直播间小助手
|
* 修改小助手
|
||||||
* @param array $data
|
* @param array $data 助手信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -251,8 +250,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除管理直播间小助手
|
* 删除小助手
|
||||||
* @param array $data
|
* @param array $data 助手信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -264,8 +263,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询管理直播间小助手
|
* 查询小助手列表
|
||||||
* @param string $roomId
|
* @param string $roomId 房间ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -278,7 +277,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加主播副号
|
* 添加主播副号
|
||||||
* @param array $data
|
* @param array $data 副号信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -291,7 +290,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改主播副号
|
* 修改主播副号
|
||||||
* @param array $data
|
* @param array $data 副号信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -303,8 +302,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修删除主播副号
|
* 删除主播副号
|
||||||
* @param array $data
|
* @param array $data 副号信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -316,8 +315,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询除主播副号
|
* 查询主播副号
|
||||||
* @param string $roomId
|
* @param string $roomId 房间ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -329,8 +328,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启/关闭直播间官方收录
|
* 开关官方收录
|
||||||
* @param array $data
|
* @param array $data 房间配置
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -342,8 +341,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启/关闭回放功能
|
* 开关回放
|
||||||
* @param array $data
|
* @param array $data 房间配置
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -355,8 +354,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启/关闭客服功能
|
* 开关客服
|
||||||
* @param array $data
|
* @param array $data 房间配置
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -368,8 +367,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启/关闭直播间全局禁言
|
* 开关全局禁言
|
||||||
* @param array $data
|
* @param array $data 房间配置
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -382,7 +381,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 上下架商品
|
* 上下架商品
|
||||||
* @param array $data
|
* @param array $data 商品参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -395,7 +394,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除直播间商品
|
* 删除直播间商品
|
||||||
* @param array $data
|
* @param array $data 商品参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -408,7 +407,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送商品
|
* 推送商品
|
||||||
* @param array $data
|
* @param array $data 商品参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -421,7 +420,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品排序
|
* 商品排序
|
||||||
* @param array $data
|
* @param array $data 排序参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -434,7 +433,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载商品讲解视频
|
* 下载商品讲解视频
|
||||||
* @param array $data
|
* @param array $data 商品信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -447,7 +446,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取长期订阅用户
|
* 获取长期订阅用户
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -459,8 +458,8 @@ class Live extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 长期订阅群发接口
|
* 长订阅群发
|
||||||
* @param array $data
|
* @param array $data 消息参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -474,7 +473,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置成员角色
|
* 设置成员角色
|
||||||
* @param array $data
|
* @param array $data 角色参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -488,7 +487,7 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 解除成员角色
|
* 解除成员角色
|
||||||
* @param array $data
|
* @param array $data 角色参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -502,10 +501,10 @@ class Live extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询成员角色
|
* 查询成员角色
|
||||||
* @param int $role
|
* @param int $role 角色过滤,-1 全部
|
||||||
* @param int $offset
|
* @param int $offset 起始
|
||||||
* @param int $limit
|
* @param int $limit 数量
|
||||||
* @param string $keyword
|
* @param string $keyword 关键词
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序物流助手
|
* 小程序物流助手
|
||||||
* Class Logistics
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Logistics extends BasicWeChat
|
class Logistics extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 生成运单
|
* 生成运单
|
||||||
* @param array $data
|
* @param array $data 运单参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -40,7 +39,7 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消运单
|
* 取消运单
|
||||||
* @param array $data
|
* @param array $data 取消参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -52,7 +51,7 @@ class Logistics extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取支持的快递公司列表
|
* 获取快递公司列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -65,7 +64,7 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取运单数据
|
* 获取运单数据
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -78,7 +77,7 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询运单轨迹
|
* 查询运单轨迹
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -90,7 +89,7 @@ class Logistics extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取打印员。若需要使用微信打单 PC 软件,才需要调用
|
* 获取打印员列表(需使用微信打单时调用)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -102,8 +101,8 @@ class Logistics extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取电子面单余额。仅在使用加盟类快递公司时,才可以调用
|
* 获取电子面单余额(加盟类快递)
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -115,8 +114,8 @@ class Logistics extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模拟快递公司更新订单状态, 该接口只能用户测试
|
* 模拟更新订单状态(测试用)
|
||||||
* @param array $data
|
* @param array $data 模拟参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -128,8 +127,8 @@ class Logistics extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置面单打印员,若需要使用微信打单 PC 软件,才需要调用
|
* 配置面单打印员(微信打单)
|
||||||
* @param array $data
|
* @param array $data 配置参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -142,7 +141,7 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取面单联系人信息
|
* 获取面单联系人信息
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -154,8 +153,8 @@ class Logistics extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预览面单模板。用于调试面单模板使用
|
* 预览面单模板(调试用)
|
||||||
* @param array $data
|
* @param array $data 模板参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -168,7 +167,7 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商户审核结果
|
* 更新商户审核结果
|
||||||
* @param array $data
|
* @param array $data 审核结果
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -181,7 +180,7 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新运单轨迹
|
* 更新运单轨迹
|
||||||
* @param array $data
|
* @param array $data 轨迹参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -195,7 +194,7 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定/解绑物流账号
|
* 绑定/解绑物流账号
|
||||||
* @param array $data
|
* @param array $data 账号参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -208,8 +207,8 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有绑定的物流账号
|
* 获取已绑定的物流账号列表
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -222,7 +221,7 @@ class Logistics extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量获取运单数据
|
* 批量获取运单数据
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,15 +19,14 @@ namespace WeMini;
|
|||||||
use WeChat\Contracts\BasicWeChat;
|
use WeChat\Contracts\BasicWeChat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序服务市场
|
* 小程序服务市场
|
||||||
* Class Ocr
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Market extends BasicWeChat
|
class Market extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 调用服务平台上架的API
|
* 调用上架服务
|
||||||
* @param array $data
|
* @param array $data 服务参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,8 +38,8 @@ class Market extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取服务市场返回的数据
|
* 拉取服务结果
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -21,7 +21,6 @@ use WeChat\Contracts\Tools;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序素材操作
|
* 小程序素材操作
|
||||||
* Class Media
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Media extends BasicWeChat
|
class Media extends BasicWeChat
|
||||||
@ -29,7 +28,7 @@ class Media extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取客服消息内的临时素材
|
* 获取客服消息内的临时素材
|
||||||
* @param array $data
|
* @param string $media_id 媒体 ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -42,7 +41,7 @@ class Media extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增图片素材
|
* 新增图片素材
|
||||||
* @param array $data
|
* @param string $filename 本地文件
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序动态消息
|
* 小程序动态消息
|
||||||
* Class Message
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Message extends BasicWeChat
|
class Message extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 动态消息,创建被分享动态消息的 activity_id
|
* 创建动态消息 activity_id
|
||||||
* @param array $data
|
* @param array $data 请求参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,8 +38,8 @@ class Message extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 动态消息,修改被分享的动态消息
|
* 修改动态消息
|
||||||
* @param array $data
|
* @param array $data 消息数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -52,8 +51,8 @@ class Message extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下发小程序和公众号统一的服务消息
|
* 统一服务消息下发
|
||||||
* @param array $data
|
* @param array $data 消息内容
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,15 +19,14 @@ namespace WeMini;
|
|||||||
use WeChat\Contracts\BasicWeChat;
|
use WeChat\Contracts\BasicWeChat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号小程序订阅消息支持
|
* 小程序订阅消息
|
||||||
* Class Mini
|
* @package WeMini
|
||||||
* @package WeChat
|
|
||||||
*/
|
*/
|
||||||
class Newtmpl extends BasicWeChat
|
class Newtmpl extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 获取小程序账号的类目
|
* 添加账号类目
|
||||||
* @param array $data 类目信息列表
|
* @param array $data 类目信息
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,7 +38,7 @@ class Newtmpl extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小程序账号的类目
|
* 获取账号类目
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -51,7 +50,7 @@ class Newtmpl extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小程序账号的类目
|
* 删除账号类目
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -63,8 +62,8 @@ class Newtmpl extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取帐号所属类目下的公共模板标题
|
* 获取类目下公共模板标题
|
||||||
* @param string $ids 类目 id,多个用逗号隔开
|
* @param string $ids 类目ID,逗号分隔
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -77,8 +76,8 @@ class Newtmpl extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取模板标题下的关键词列表
|
* 获取模板标题关键词
|
||||||
* @param string $tid 模板标题 id,可通过接口获取
|
* @param string $tid 模板标题ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -91,10 +90,10 @@ class Newtmpl extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组合模板并添加至帐号下的个人模板库
|
* 组合模板并入库
|
||||||
* @param string $tid 模板标题 id,可通过接口获取,也可登录小程序后台查看获取
|
* @param string $tid 模板标题ID
|
||||||
* @param array $kidList 开发者自行组合好的模板关键词列表,关键词顺序可以自由搭配(例如 [3,5,4] 或 [4,5,3]),最多支持5个,最少2个关键词组合
|
* @param array $kidList 关键词ID列表
|
||||||
* @param string $sceneDesc 服务场景描述,15个字以内
|
* @param string $sceneDesc 场景描述
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -106,7 +105,7 @@ class Newtmpl extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前帐号下的个人模板列表
|
* 获取个人模板列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -118,8 +117,8 @@ class Newtmpl extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除帐号下的个人模板
|
* 删除个人模板
|
||||||
* @param string $priTmplId 要删除的模板id
|
* @param string $priTmplId 模板ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -132,7 +131,7 @@ class Newtmpl extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送订阅消息
|
* 发送订阅消息
|
||||||
* @param array $data 发送的消息对象数组
|
* @param array $data 消息数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序ORC服务
|
* 小程序ORC服务
|
||||||
* Class Ocr
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Ocr extends BasicWeChat
|
class Ocr extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的银行卡 OCR 识别
|
* 银行卡 OCR
|
||||||
* @param array $data
|
* @param array $data 图片参数(img_url 或 img)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,8 +38,8 @@ class Ocr extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的营业执照 OCR 识别
|
* 营业执照 OCR
|
||||||
* @param array $data
|
* @param array $data 图片参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -52,8 +51,8 @@ class Ocr extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的驾驶证 OCR 识别
|
* 驾驶证 OCR
|
||||||
* @param array $data
|
* @param array $data 图片参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -65,8 +64,8 @@ class Ocr extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的身份证 OCR 识别
|
* 身份证 OCR
|
||||||
* @param array $data
|
* @param array $data 图片参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -78,8 +77,8 @@ class Ocr extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的通用印刷体 OCR 识别
|
* 通用印刷体 OCR
|
||||||
* @param array $data
|
* @param array $data 图片参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -91,8 +90,8 @@ class Ocr extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本接口提供基于小程序的行驶证 OCR 识别
|
* 行驶证 OCR
|
||||||
* @param array $data
|
* @param array $data 图片参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序运维中心
|
* 小程序运维中心
|
||||||
* Class Operation
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Operation extends BasicWeChat
|
class Operation extends BasicWeChat
|
||||||
@ -28,7 +27,7 @@ class Operation extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 实时日志查询
|
* 实时日志查询
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -40,8 +39,8 @@ class Operation extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 mediaId 图片
|
* 获取反馈媒体文件
|
||||||
* @param array $data
|
* @param array $data query 参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -49,14 +48,14 @@ class Operation extends BasicWeChat
|
|||||||
public function getFeedbackmedia($data)
|
public function getFeedbackmedia($data)
|
||||||
{
|
{
|
||||||
$query = http_build_query($data);
|
$query = http_build_query($data);
|
||||||
$url = 'https://api.weixin.qq.com/cgi-bin/media/getfeedbackmedia?'. $query .'&access_token=ACCESS_TOKEN';
|
$url = 'https://api.weixin.qq.com/cgi-bin/media/getfeedbackmedia?' . $query . '&access_token=ACCESS_TOKEN';
|
||||||
return $this->callGetApi($url);
|
return $this->callGetApi($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实时日志查询
|
* 获取用户反馈列表
|
||||||
* @param array $data
|
* @param array $data query 参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -64,7 +63,7 @@ class Operation extends BasicWeChat
|
|||||||
public function getFeedback($data)
|
public function getFeedback($data)
|
||||||
{
|
{
|
||||||
$query = http_build_query($data);
|
$query = http_build_query($data);
|
||||||
$url = 'https://api.weixin.qq.com/wxaapi/userlog/userlog_search?'.$query.'&access_token=ACCESS_TOKEN';
|
$url = 'https://api.weixin.qq.com/wxaapi/userlog/userlog_search?' . $query . '&access_token=ACCESS_TOKEN';
|
||||||
return $this->callGetApi($url);
|
return $this->callGetApi($url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,15 +19,14 @@ namespace WeMini;
|
|||||||
use WeChat\Contracts\BasicWeChat;
|
use WeChat\Contracts\BasicWeChat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序插件管理
|
* 小程序插件管理
|
||||||
* Class Plugs
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Plugs extends BasicWeChat
|
class Plugs extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 1.申请使用插件
|
* 申请使用插件
|
||||||
* @param string $plugin_appid 插件appid
|
* @param string $plugin_appid 插件 appid
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,7 +38,7 @@ class Plugs extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2.查询已添加的插件
|
* 查询已添加插件
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -51,8 +50,8 @@ class Plugs extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 3.删除已添加的插件
|
* 删除插件
|
||||||
* @param string $plugin_appid 插件appid
|
* @param string $plugin_appid 插件 appid
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -64,9 +63,8 @@ class Plugs extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前所有插件使用方
|
* 获取插件使用方或修改申请状态
|
||||||
* 修改插件使用申请的状态
|
* @param array $data 请求参数
|
||||||
* @param array $data
|
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -78,9 +76,9 @@ class Plugs extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 4.获取当前所有插件使用方(供插件开发者调用)
|
* 获取插件使用方列表(开发者)
|
||||||
* @param integer $page 拉取第page页的数据
|
* @param int $page 页码
|
||||||
* @param integer $num 表示每页num条记录
|
* @param int $num 每页数量
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -93,8 +91,8 @@ class Plugs extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 5.修改插件使用申请的状态(供插件开发者调用)
|
* 修改插件申请状态(开发者)
|
||||||
* @param string $action dev_agree:同意申请;dev_refuse:拒绝申请;dev_delete:删除已拒绝的申请者
|
* @param string $action dev_agree|dev_refuse|dev_delete
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,18 +19,17 @@ namespace WeMini;
|
|||||||
use WeChat\Contracts\BasicWeChat;
|
use WeChat\Contracts\BasicWeChat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序地址管理
|
* 小程序地址管理
|
||||||
* Class Poi
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Poi extends BasicWeChat
|
class Poi extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 添加地点
|
* 添加附近地点
|
||||||
* @param string $related_name 经营资质主体
|
* @param string $related_name 经营主体
|
||||||
* @param string $related_credential 经营资质证件号
|
* @param string $related_credential 证件号
|
||||||
* @param string $related_address 经营资质地址
|
* @param string $related_address 地址
|
||||||
* @param string $related_proof_material 相关证明材料照片临时素材mediaid
|
* @param string $related_proof_material 证明材料 media_id
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -47,8 +46,8 @@ class Poi extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看地点列表
|
* 查看地点列表
|
||||||
* @param integer $page 起始页id(从1开始计数)
|
* @param int $page 页码从1开始
|
||||||
* @param integer $page_rows 每页展示个数(最多1000个)
|
* @param int $page_rows 每页数量(<=1000)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -60,8 +59,8 @@ class Poi extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除地点
|
* 删除附近地点
|
||||||
* @param string $poi_id 附近地点ID
|
* @param string $poi_id 地点ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -73,9 +72,9 @@ class Poi extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 展示/取消展示附近小程序
|
* 设置附近小程序展示
|
||||||
* @param string $poi_id 附近地点ID
|
* @param string $poi_id 地点ID
|
||||||
* @param string $status 0:取消展示;1:展示
|
* @param string $status 0 取消 | 1 展示
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -21,7 +21,6 @@ use WeChat\Contracts\Tools;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序二维码
|
* 微信小程序二维码
|
||||||
* Class Qrcode
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Qrcode extends BasicWeChat
|
class Qrcode extends BasicWeChat
|
||||||
@ -56,6 +55,26 @@ class Qrcode extends BasicWeChat
|
|||||||
return $this->parseResult(Tools::post($url, Tools::arr2json(array_merge($data, $extra))), $outType);
|
return $this->parseResult(Tools::post($url, Tools::arr2json(array_merge($data, $extra))), $outType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解释接口数据
|
||||||
|
* @param bool|string $result
|
||||||
|
* @param null|string $outType
|
||||||
|
* @return array|mixed
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
*/
|
||||||
|
private function parseResult($result, $outType)
|
||||||
|
{
|
||||||
|
if (is_array($json = json_decode($result, true))) {
|
||||||
|
if (!$this->isTry && isset($json['errcode']) && in_array($json['errcode'], ['40014', '40001', '41001', '42001'])) {
|
||||||
|
[$this->delAccessToken(), $this->isTry = true];
|
||||||
|
return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']);
|
||||||
|
}
|
||||||
|
return Tools::json2arr($result);
|
||||||
|
} else {
|
||||||
|
return is_null($outType) ? $result : $outType($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小程序码(永久有效)
|
* 获取小程序码(永久有效)
|
||||||
* 接口B:适用于需要的码数量极多的业务场景
|
* 接口B:适用于需要的码数量极多的业务场景
|
||||||
@ -97,24 +116,4 @@ class Qrcode extends BasicWeChat
|
|||||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||||
return $this->parseResult(Tools::post($url, Tools::arr2json(['path' => $path, 'width' => $width])), $outType);
|
return $this->parseResult(Tools::post($url, Tools::arr2json(['path' => $path, 'width' => $width])), $outType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 解释接口数据
|
|
||||||
* @param bool|string $result
|
|
||||||
* @param null|string $outType
|
|
||||||
* @return array|mixed
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
*/
|
|
||||||
private function parseResult($result, $outType)
|
|
||||||
{
|
|
||||||
if (is_array($json = json_decode($result, true))) {
|
|
||||||
if (!$this->isTry && isset($json['errcode']) && in_array($json['errcode'], ['40014', '40001', '41001', '42001'])) {
|
|
||||||
[$this->delAccessToken(), $this->isTry = true];
|
|
||||||
return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']);
|
|
||||||
}
|
|
||||||
return Tools::json2arr($result);
|
|
||||||
} else {
|
|
||||||
return is_null($outType) ? $result : $outType($result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序 URL-Scheme
|
* 小程序 URL-Scheme
|
||||||
* Class Scheme
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Scheme extends BasicWeChat
|
class Scheme extends BasicWeChat
|
||||||
@ -28,7 +27,7 @@ class Scheme extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建 URL-Scheme
|
* 创建 URL-Scheme
|
||||||
* @param array $data
|
* @param array $data 场景参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -41,7 +40,7 @@ class Scheme extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询 URL-Scheme
|
* 查询 URL-Scheme
|
||||||
* @param string $scheme
|
* @param string $scheme Scheme 字符串
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -54,7 +53,7 @@ class Scheme extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建 URL-Link
|
* 创建 URL-Link
|
||||||
* @param array $data
|
* @param array $data 场景参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -67,7 +66,7 @@ class Scheme extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询 URL-Link
|
* 查询 URL-Link
|
||||||
* @param string $urllink
|
* @param string $urllink URL-Link 字符串
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序搜索
|
* 小程序搜索
|
||||||
* Class Search
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Search extends BasicWeChat
|
class Search extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 提交小程序页面url及参数信息
|
* 提交页面 URL 及参数
|
||||||
* @param array $pages
|
* @param array $pages 页面列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,15 +20,14 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序内容安全
|
* 小程序内容安全
|
||||||
* Class Security
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Security extends BasicWeChat
|
class Security extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验一张图片是否含有违法违规内容
|
* 图片内容安全校验
|
||||||
* @param string $media 要检测的图片文件,格式支持PNG、JPEG、JPG、GIF,图片尺寸不超过 750px x 1334px
|
* @param string $media 图片文件
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -40,9 +39,9 @@ class Security extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步校验图片/音频是否含有违法违规内容
|
* 异步校验媒体(图片/音频)
|
||||||
* @param string $media_url
|
* @param string $media_url 媒体 URL
|
||||||
* @param string $media_type
|
* @param string $media_type 1 音频 | 2 图片
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -54,8 +53,8 @@ class Security extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查一段文本是否含有违法违规内容
|
* 文本内容安全校验
|
||||||
* @param string $content
|
* @param string $content 文本内容
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -5,16 +5,15 @@ namespace WeMini;
|
|||||||
use WeChat\Contracts\BasicWeChat;
|
use WeChat\Contracts\BasicWeChat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序发货信息管理服务
|
* 小程序发货信息管理
|
||||||
* @class Shipping
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Shipping extends BasicWeChat
|
class Shipping extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货信息录入接口
|
* 录入发货信息
|
||||||
* @param array $data
|
* @param array $data 发货数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -26,8 +25,8 @@ class Shipping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货信息合单录入接口
|
* 合单发货录入
|
||||||
* @param array $data
|
* @param array $data 发货数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,8 +38,8 @@ class Shipping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单发货状态
|
* 查询发货状态
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -52,8 +51,8 @@ class Shipping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单列表
|
* 查询发货订单列表
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -65,8 +64,8 @@ class Shipping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认收货提醒接口
|
* 提醒确认收货
|
||||||
* @param array $data
|
* @param array $data 提醒参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -78,8 +77,8 @@ class Shipping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息跳转路径设置接口
|
* 设置消息跳转路径
|
||||||
* @param array $data
|
* @param array $data 路径参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -91,8 +90,8 @@ class Shipping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询小程序是否已开通发货信息管理服务
|
* 查询是否开通发货管理
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -104,8 +103,8 @@ class Shipping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询小程序是否已完成交易结算管理确认
|
* 查询交易结算确认状态
|
||||||
* @param array $data
|
* @param array $data 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,7 +20,6 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序购物订单
|
* 小程序购物订单
|
||||||
* Class Shopping
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Shopping extends BasicWeChat
|
class Shopping extends BasicWeChat
|
||||||
@ -28,7 +27,7 @@ class Shopping extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传购物详情
|
* 上传购物详情
|
||||||
* @param array $data
|
* @param array $data 订单数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -41,7 +40,7 @@ class Shopping extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传物流信息
|
* 上传物流信息
|
||||||
* @param array $data
|
* @param array $data 物流数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -54,7 +53,7 @@ class Shopping extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传合单购物详情
|
* 上传合单购物详情
|
||||||
* @param array $data
|
* @param array $data 订单数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -66,8 +65,8 @@ class Shopping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传合单物流信息
|
* 上传合单物流
|
||||||
* @param array $data
|
* @param array $data 物流数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -79,8 +78,8 @@ class Shopping extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证购物订单上传结果
|
* 校验购物订单上传结果
|
||||||
* @param array $data
|
* @param array $data 校验参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,14 +20,13 @@ use WeChat\Contracts\BasicWeChat;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序生物认证
|
* 小程序生物认证
|
||||||
* Class Soter
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Soter extends BasicWeChat
|
class Soter extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* SOTER 生物认证秘钥签名验证
|
* SOTER 签名验证
|
||||||
* @param array $data
|
* @param array $data 签名数据
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,15 +19,14 @@ namespace WeMini;
|
|||||||
use WeChat\Contracts\BasicWeChat;
|
use WeChat\Contracts\BasicWeChat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号小程序模板消息支持
|
* 小程序模板消息
|
||||||
* Class Mini
|
* @package WeMini
|
||||||
* @package WeChat
|
|
||||||
*/
|
*/
|
||||||
class Template extends BasicWeChat
|
class Template extends BasicWeChat
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小程序模板库标题列表
|
* 获取模板库标题列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -39,8 +38,8 @@ class Template extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取模板库某个模板标题下关键词库
|
* 获取模板关键词库
|
||||||
* @param string $template_id 模板标题id,可通过接口获取,也可登录小程序后台查看获取
|
* @param string $template_id 模板标题ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -52,9 +51,9 @@ class Template extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组合模板并添加至帐号下的个人模板库
|
* 组合关键词并添加模板
|
||||||
* @param string $template_id 模板标题id,可通过接口获取,也可登录小程序后台查看获取
|
* @param string $template_id 模板标题ID
|
||||||
* @param array $keyword_id_list 开发者自行组合好的模板关键词列表,关键词顺序可以自由搭配(例如[3,5,4]或[4,5,3]),最多支持10个关键词组合
|
* @param array $keyword_id_list 关键词 ID 列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -66,7 +65,7 @@ class Template extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取帐号下已存在的模板列表
|
* 获取帐号模板列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -78,8 +77,8 @@ class Template extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除模板消息
|
* 删除模板
|
||||||
* @param string $template_id 要删除的模板id
|
* @param string $template_id 模板 ID
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -92,7 +91,7 @@ class Template extends BasicWeChat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送模板消息
|
* 发送模板消息
|
||||||
* @param array $data 发送的消息对象数组
|
* @param array $data 消息体(touser, template_id, form_id, data 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,16 +19,15 @@ namespace WeMini;
|
|||||||
use WeChat\Contracts\BasicWeChat;
|
use WeChat\Contracts\BasicWeChat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序数据接口
|
* 小程序数据统计
|
||||||
* Class Total
|
|
||||||
* @package WeMini
|
* @package WeMini
|
||||||
*/
|
*/
|
||||||
class Total extends BasicWeChat
|
class Total extends BasicWeChat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 数据分析接口
|
* 概况趋势(日)
|
||||||
* @param string $beginDate 开始日期
|
* @param string $beginDate 开始日期
|
||||||
* @param string $endDate 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
|
* @param string $endDate 结束日期,需同一天
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -40,9 +39,9 @@ class Total extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访问分析
|
* 访问趋势(日)
|
||||||
* @param string $beginDate 开始日期
|
* @param string $beginDate 开始日期
|
||||||
* @param string $endDate 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
|
* @param string $endDate 结束日期,需同一天
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -54,9 +53,9 @@ class Total extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 周趋势
|
* 访问趋势(周)
|
||||||
* @param string $begin_date 开始日期,为周一日期
|
* @param string $begin_date 周一
|
||||||
* @param string $end_date 结束日期,为周日日期,限定查询一周数据
|
* @param string $end_date 周日
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -68,9 +67,9 @@ class Total extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 月趋势
|
* 访问趋势(月)
|
||||||
* @param string $begin_date 开始日期,为自然月第一天
|
* @param string $begin_date 月首日
|
||||||
* @param string $end_date 结束日期,为自然月最后一天,限定查询一个月数据
|
* @param string $end_date 月末日
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -84,7 +83,7 @@ class Total extends BasicWeChat
|
|||||||
/**
|
/**
|
||||||
* 访问分布
|
* 访问分布
|
||||||
* @param string $begin_date 开始日期
|
* @param string $begin_date 开始日期
|
||||||
* @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
|
* @param string $end_date 结束日期,需同一天
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -96,9 +95,9 @@ class Total extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日留存
|
* 留存(日)
|
||||||
* @param string $begin_date 开始日期
|
* @param string $begin_date 开始日期
|
||||||
* @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
|
* @param string $end_date 结束日期,需同一天
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -110,9 +109,9 @@ class Total extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 周留存
|
* 留存(周)
|
||||||
* @param string $begin_date 开始日期,为周一日期
|
* @param string $begin_date 周一
|
||||||
* @param string $end_date 结束日期,为周日日期,限定查询一周数据
|
* @param string $end_date 周日
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -124,9 +123,9 @@ class Total extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 月留存
|
* 留存(月)
|
||||||
* @param string $begin_date 开始日期,为自然月第一天
|
* @param string $begin_date 月首日
|
||||||
* @param string $end_date 结束日期,为自然月最后一天,限定查询一个月数据
|
* @param string $end_date 月末日
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -138,9 +137,9 @@ class Total extends BasicWeChat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访问页面
|
* 访问页面数据
|
||||||
* @param string $begin_date 开始日期
|
* @param string $begin_date 开始日期
|
||||||
* @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
|
* @param string $end_date 结束日期,需同一天
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -154,7 +153,7 @@ class Total extends BasicWeChat
|
|||||||
/**
|
/**
|
||||||
* 用户画像
|
* 用户画像
|
||||||
* @param string $begin_date 开始日期
|
* @param string $begin_date 开始日期
|
||||||
* @param string $end_date 结束日期,开始日期与结束日期相差的天数限定为0/6/29,分别表示查询最近1/7/30天数据,end_date允许设置的最大值为昨日
|
* @param string $end_date 结束日期,间隔为0/6/29
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 对微信小程序用户加密数据的解密示例代码
|
* 对微信小程序用户加密数据的解密示例代码
|
||||||
* Class WXBizDataCrypt
|
|
||||||
* @copyright Copyright (c) 1998-2014 Tencent Inc.
|
* @copyright Copyright (c) 1998-2014 Tencent Inc.
|
||||||
*/
|
*/
|
||||||
class WXBizDataCrypt
|
class WXBizDataCrypt
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -22,16 +22,15 @@ use WeChat\Exceptions\InvalidResponseException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信商户账单及评论
|
* 微信商户账单及评论
|
||||||
* Class Bill
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class Bill extends BasicWePay
|
class Bill extends BasicWePay
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 下载对账单
|
* 下载对账单
|
||||||
* @param array $options 静音参数
|
* @param array $options 账单参数(bill_date, bill_type 等)
|
||||||
* @param null|string $outType 输出类型
|
* @param null|string $outType 输出处理回调,为 null 则返回原始内容
|
||||||
* @return bool|string
|
* @return bool|string 原始账单文本或回调结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -51,9 +50,9 @@ class Bill extends BasicWePay
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取订单评价数据
|
* 拉取订单评价数据(需证书)
|
||||||
* @param array $options
|
* @param array $options 查询参数(bill_date, offset, limit 等)
|
||||||
* @return array
|
* @return array 评价数据
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,15 +20,14 @@ use WeChat\Contracts\BasicWePay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信商户代金券
|
* 微信商户代金券
|
||||||
* Class Coupon
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class Coupon extends BasicWePay
|
class Coupon extends BasicWePay
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 发放代金券
|
* 发放代金券(需证书)
|
||||||
* @param array $options
|
* @param array $options 代金券参数(coupon_stock_id, openid, partner_trade_no, op_user_id 等)
|
||||||
* @return array
|
* @return array 发券结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -40,8 +39,8 @@ class Coupon extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询代金券批次
|
* 查询代金券批次
|
||||||
* @param array $options
|
* @param array $options 查询参数(coupon_stock_id 等)
|
||||||
* @return array
|
* @return array 批次详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -52,9 +51,9 @@ class Coupon extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询代金券信息
|
* 查询单个代金券信息
|
||||||
* @param array $options
|
* @param array $options 查询参数(coupon_id, openid, stock_id 等)
|
||||||
* @return array
|
* @return array 代金券详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,16 +20,15 @@ use WeChat\Contracts\BasicWePay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信扩展上报海关
|
* 微信扩展上报海关
|
||||||
* Class Custom
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class Custom extends BasicWePay
|
class Custom extends BasicWePay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单附加信息提交接口
|
* 海关申报:订单附加信息提交
|
||||||
* @param array $options
|
* @param array $options 申报参数(transaction_id 或 out_trade_no,customs,mch_customs_no 等)
|
||||||
* @return array
|
* @return array 申报结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -40,9 +39,9 @@ class Custom extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单附加信息查询接口
|
* 海关申报:订单附加信息查询
|
||||||
* @param array $options
|
* @param array $options 查询参数(transaction_id 或 out_trade_no,customs,mch_customs_no 等)
|
||||||
* @return array
|
* @return array 申报状态
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -54,9 +53,9 @@ class Custom extends BasicWePay
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单附加信息重推接口
|
* 海关申报:重推申报信息
|
||||||
* @param array $options
|
* @param array $options 重推参数(transaction_id 或 out_trade_no,customs,mch_customs_no 等)
|
||||||
* @return array
|
* @return array 重推结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -21,16 +21,15 @@ use WeChat\Contracts\Tools;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信商户订单
|
* 微信商户订单
|
||||||
* Class Order
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class Order extends BasicWePay
|
class Order extends BasicWePay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一下单
|
* 统一下单接口
|
||||||
* @param array $options
|
* @param array $options 订单参数(out_trade_no, body, total_fee, notify_url, trade_type等)
|
||||||
* @return array
|
* @return array 返回prepay_id等支付参数
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -41,9 +40,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷卡支付
|
* 刷卡支付接口(被扫支付)
|
||||||
* @param array $options
|
* @param array $options 支付参数(auth_code, out_trade_no, body, total_fee等)
|
||||||
* @return array
|
* @return array 支付结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -54,9 +53,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单
|
* 查询订单接口
|
||||||
* @param array $options
|
* @param array $options 查询参数(transaction_id或out_trade_no二选一)
|
||||||
* @return array
|
* @return array 订单详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -67,9 +66,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭订单
|
* 关闭订单接口
|
||||||
* @param string $outTradeNo 商户订单号
|
* @param string $outTradeNo 商户订单号
|
||||||
* @return array
|
* @return array 关闭结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -80,9 +79,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建JsApi及H5支付参数
|
* 生成JSAPI支付参数(用于前端调起支付)
|
||||||
* @param string $prepayId 统一下单预支付码
|
* @param string $prepayId 统一下单返回的prepay_id
|
||||||
* @return array
|
* @return array JSAPI支付所需参数(appId, timeStamp, nonceStr, package, signType, paySign)
|
||||||
*/
|
*/
|
||||||
public function jsapiParams($prepayId)
|
public function jsapiParams($prepayId)
|
||||||
{
|
{
|
||||||
@ -98,9 +97,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取支付规则二维码
|
* 生成Native支付二维码URL
|
||||||
* @param string $productId 商户定义的商品id或者订单号
|
* @param string $productId 商品ID或订单号
|
||||||
* @return string
|
* @return string 支付二维码URL(weixin://wxpay/bizpayurl?xxx)
|
||||||
*/
|
*/
|
||||||
public function qrcParams($productId)
|
public function qrcParams($productId)
|
||||||
{
|
{
|
||||||
@ -116,9 +115,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取微信App支付秘需参数
|
* 生成APP支付参数(用于移动应用调起支付)
|
||||||
* @param string $prepayId 统一下单预支付码
|
* @param string $prepayId 统一下单返回的prepay_id
|
||||||
* @return array
|
* @return array APP支付所需参数(appid, partnerid, prepayid, package, timestamp, noncestr, sign)
|
||||||
*/
|
*/
|
||||||
public function appParams($prepayId)
|
public function appParams($prepayId)
|
||||||
{
|
{
|
||||||
@ -135,9 +134,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷卡支付 撤销订单
|
* 撤销订单接口(刷卡支付专用,需要证书)
|
||||||
* @param array $options
|
* @param array $options 撤销参数(transaction_id或out_trade_no二选一)
|
||||||
* @return array
|
* @return array 撤销结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -148,9 +147,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷卡支付 授权码查询openid
|
* 授权码查询openid接口
|
||||||
* @param string $authCode 扫码支付授权码,设备读取用户微信中的条码或者二维码信息
|
* @param string $authCode 授权码(用户微信中的条码或二维码信息)
|
||||||
* @return array
|
* @return array 包含openid等信息
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -161,9 +160,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷卡支付 交易保障
|
* 交易保障接口(用于上报交易数据)
|
||||||
* @param array $options
|
* @param array $options 上报参数(interface_url, execute_time, return_code, result_code等)
|
||||||
* @return array
|
* @return array 上报结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,16 +20,15 @@ use WeChat\Contracts\BasicWePay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信分账
|
* 微信分账
|
||||||
* Class ProfitSharing
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class ProfitSharing extends BasicWePay
|
class ProfitSharing extends BasicWePay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求单次分账
|
* 请求单次分账(需证书)
|
||||||
* @param array $options
|
* @param array $options 分账参数(transaction_id, out_order_no, receivers 等)
|
||||||
* @return array
|
* @return array 分账结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -40,9 +39,9 @@ class ProfitSharing extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求多次分账
|
* 请求多次分账(需证书)
|
||||||
* @param array $options
|
* @param array $options 分账参数(transaction_id, out_order_no, receivers 等)
|
||||||
* @return array
|
* @return array 分账结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -54,8 +53,8 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询分账结果
|
* 查询分账结果
|
||||||
* @param array $options
|
* @param array $options 查询参数(transaction_id 与 out_order_no)
|
||||||
* @return array
|
* @return array 分账状态
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -67,7 +66,7 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加分账接收方
|
* 添加分账接收方
|
||||||
* @param array $options
|
* @param array $options 接收方信息(type, account, name, relation_type 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -80,7 +79,7 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除分账接收方
|
* 删除分账接收方
|
||||||
* @param array $options
|
* @param array $options 接收方信息(type, account)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -92,9 +91,9 @@ class ProfitSharing extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完结分账
|
* 完结分账(需证书)
|
||||||
* @param array $options
|
* @param array $options 完结参数(transaction_id, out_order_no, description 等)
|
||||||
* @return array
|
* @return array 完结结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -106,8 +105,8 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单待分账金额
|
* 查询订单待分账金额
|
||||||
* @param array $options
|
* @param array $options 查询参数(transaction_id)
|
||||||
* @return array
|
* @return array 待分账金额
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -118,9 +117,9 @@ class ProfitSharing extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分账回退
|
* 分账回退(需证书)
|
||||||
* @param array $options
|
* @param array $options 回退参数(out_return_no, out_order_no, return_account_type 等)
|
||||||
* @return array
|
* @return array 回退结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -132,8 +131,8 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 回退结果查询
|
* 回退结果查询
|
||||||
* @param array $options
|
* @param array $options 查询参数(out_return_no 与 out_order_no)
|
||||||
* @return array
|
* @return array 回退状态
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,16 +20,15 @@ use WeChat\Contracts\BasicWePay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信红包支持
|
* 微信红包支持
|
||||||
* Class Redpack
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class Redpack extends BasicWePay
|
class Redpack extends BasicWePay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发放普通红包
|
* 发放普通红包(需证书)
|
||||||
* @param array $options
|
* @param array $options 红包参数(mch_billno, send_name, re_openid, total_amount, total_num, wishing 等)
|
||||||
* @return array
|
* @return array 红包发送结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -42,9 +41,9 @@ class Redpack extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发放裂变红包
|
* 发放裂变红包(需证书)
|
||||||
* @param array $options
|
* @param array $options 红包参数(mch_billno, send_name, re_openid, total_amount, total_num 等,total_num>1)
|
||||||
* @return array
|
* @return array 红包发送结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -58,8 +57,8 @@ class Redpack extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询红包记录
|
* 查询红包记录
|
||||||
* @param string $mchBillno 商户发放红包的商户订单号
|
* @param string $mchBillno 商户红包订单号
|
||||||
* @return array
|
* @return array 红包状态信息
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -23,16 +23,15 @@ use WeChat\Exceptions\InvalidResponseException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信商户退款
|
* 微信商户退款
|
||||||
* Class Refund
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class Refund extends BasicWePay
|
class Refund extends BasicWePay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建退款订单
|
* 申请退款接口(需要证书)
|
||||||
* @param array $options
|
* @param array $options 退款参数(transaction_id或out_trade_no, out_refund_no, total_fee, refund_fee等)
|
||||||
* @return array
|
* @return array 退款结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -43,9 +42,9 @@ class Refund extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询退款
|
* 查询退款接口
|
||||||
* @param array $options
|
* @param array $options 查询参数(transaction_id, out_trade_no, out_refund_no, refund_id四选一)
|
||||||
* @return array
|
* @return array 退款详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -56,9 +55,9 @@ class Refund extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取退款通知
|
* 解析退款通知(自动解密req_info)
|
||||||
* @param string|array $xml
|
* @param string|array $xml 退款通知XML数据,为空则从POST获取
|
||||||
* @return array
|
* @return array 解密后的退款通知数据
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,16 +20,15 @@ use WeChat\Contracts\BasicWePay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信商户打款到零钱
|
* 微信商户打款到零钱
|
||||||
* Class Transfers
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class Transfers extends BasicWePay
|
class Transfers extends BasicWePay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业付款到零钱
|
* 企业付款到零钱(需证书)
|
||||||
* @param array $options
|
* @param array $options 付款参数(partner_trade_no, openid, amount, desc, check_name 等)
|
||||||
* @return array
|
* @return array 付款结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -44,9 +43,9 @@ class Transfers extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询企业付款到零钱
|
* 查询企业付款到零钱结果
|
||||||
* @param string $partnerTradeNo 商户调用企业付款API时使用的商户订单号
|
* @param string $partnerTradeNo 商户付款单号
|
||||||
* @return array
|
* @return array 付款状态
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -24,16 +24,15 @@ use WeChat\Exceptions\InvalidResponseException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信商户打款到银行卡
|
* 微信商户打款到银行卡
|
||||||
* Class TransfersBank
|
|
||||||
* @package WePay
|
* @package WePay
|
||||||
*/
|
*/
|
||||||
class TransfersBank extends BasicWePay
|
class TransfersBank extends BasicWePay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业付款到银行卡
|
* 企业付款到银行卡(需证书,敏感字段 RSA 加密)
|
||||||
* @param array $options
|
* @param array $options 付款参数(partner_trade_no, enc_bank_no, enc_true_name, bank_code, amount, desc 等)
|
||||||
* @return array
|
* @return array 付款结果
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -67,24 +66,10 @@ class TransfersBank extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户企业付款到银行卡操作进行结果查询
|
* RSA 加密银行卡号/姓名
|
||||||
* @param string $partnerTradeNo 商户订单号,需保持唯一
|
* @param string $string 待加密字符串
|
||||||
* @return array
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
|
||||||
public function query($partnerTradeNo)
|
|
||||||
{
|
|
||||||
$this->params->offsetUnset('appid');
|
|
||||||
$url = 'https://api.mch.weixin.qq.com/mmpaysptrans/query_bank';
|
|
||||||
return $this->callPostApi($url, ['partner_trade_no' => $partnerTradeNo], true, 'MD5', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* RSA加密处理
|
|
||||||
* @param string $string
|
|
||||||
* @param string $encrypted
|
* @param string $encrypted
|
||||||
* @return string
|
* @return string base64 编码密文
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
@ -103,8 +88,8 @@ class TransfersBank extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取签名文件内容
|
* 获取 RSA 公钥内容
|
||||||
* @return string
|
* @return string 公钥内容
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -123,4 +108,18 @@ class TransfersBank extends BasicWePay
|
|||||||
Tools::setCache($cacheKey, $data['pub_key'], 600);
|
Tools::setCache($cacheKey, $data['pub_key'], 600);
|
||||||
return $data['pub_key'];
|
return $data['pub_key'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业付款到银行卡结果
|
||||||
|
* @param string $partnerTradeNo 商户订单号
|
||||||
|
* @return array 付款状态
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
public function query($partnerTradeNo)
|
||||||
|
{
|
||||||
|
$this->params->offsetUnset('appid');
|
||||||
|
$url = 'https://api.mch.weixin.qq.com/mmpaysptrans/query_bank';
|
||||||
|
return $this->callPostApi($url, ['partner_trade_no' => $partnerTradeNo], true, 'MD5', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -22,7 +22,6 @@ use WePayV3\Contracts\DecryptAes;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 平台证书管理
|
* 平台证书管理
|
||||||
* Class Cert
|
|
||||||
* @package WePayV3
|
* @package WePayV3
|
||||||
*/
|
*/
|
||||||
class Cert extends BasicWePay
|
class Cert extends BasicWePay
|
||||||
@ -35,7 +34,7 @@ class Cert extends BasicWePay
|
|||||||
protected $autoCert = false;
|
protected $autoCert = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户平台下载证书
|
* 下载并缓存平台证书
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -5,8 +5,7 @@ namespace WePayV3;
|
|||||||
use WePayV3\Contracts\BasicWePay;
|
use WePayV3\Contracts\BasicWePay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 普通商户消费者投诉2.0
|
* 消费者投诉 2.0
|
||||||
* @class Complaints
|
|
||||||
* @package WePayV3
|
* @package WePayV3
|
||||||
*/
|
*/
|
||||||
class Complaints extends BasicWePay
|
class Complaints extends BasicWePay
|
||||||
@ -14,11 +13,11 @@ class Complaints extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询投诉列表
|
* 查询投诉列表
|
||||||
* @param int $offset 分页开始位置
|
* @param int $offset 分页起始
|
||||||
* @param int $limit 分页大小
|
* @param int $limit 分页大小
|
||||||
* @param String $begin_date 开始日期
|
* @param string $begin_date 开始日期(YYYY-MM-DD)
|
||||||
* @param String $end_date 结束日期
|
* @param string $end_date 结束日期(YYYY-MM-DD)
|
||||||
* @return array|string
|
* @return array|string 投诉列表
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function complaintList($offset, $limit, $begin_date, $end_date)
|
public function complaintList($offset, $limit, $begin_date, $end_date)
|
||||||
@ -30,8 +29,8 @@ class Complaints extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询投诉详情
|
* 查询投诉详情
|
||||||
* @param string $complaint_id 被投诉单号
|
* @param string $complaint_id 投诉单号
|
||||||
* @return array|string
|
* @return array|string 投诉详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function complaintDetails($complaint_id)
|
public function complaintDetails($complaint_id)
|
||||||
@ -42,8 +41,8 @@ class Complaints extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询投诉协商历史
|
* 查询投诉协商历史
|
||||||
* @param string $complaint_id 被投诉单号
|
* @param string $complaint_id 投诉单号
|
||||||
* @return array|string
|
* @return array|string 协商记录
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function negotiationHistory($complaint_id)
|
public function negotiationHistory($complaint_id)
|
||||||
@ -54,7 +53,7 @@ class Complaints extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建投诉通知回调地址
|
* 创建投诉通知回调地址
|
||||||
* @param string $url 回调通知地址
|
* @param string $url 回调地址
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -77,7 +76,7 @@ class Complaints extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新投诉通知回调地址
|
* 更新投诉通知回调地址
|
||||||
* @param string $url 回调通知地址
|
* @param string $url 回调地址
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -98,8 +97,8 @@ class Complaints extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 回复投诉
|
* 回复投诉
|
||||||
* @param string $complaint_id 被投诉单号
|
* @param string $complaint_id 投诉单号
|
||||||
* @param array $content 回复内容
|
* @param array $content 回复内容(含跳转链接、文本等)
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -111,8 +110,8 @@ class Complaints extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 反馈处理完成
|
* 标记投诉处理完成
|
||||||
* @param string $complaint_id 被投诉单号
|
* @param string $complaint_id 投诉单号
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -124,8 +123,8 @@ class Complaints extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片请求接口
|
* 下载投诉图片
|
||||||
* @param string $pathinfo
|
* @param string $pathinfo 文件路径(接口返回的下载地址 path)
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -135,8 +134,8 @@ class Complaints extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片上传接口
|
* 上传投诉相关图片
|
||||||
* @param array $imginfo
|
* @param array $imginfo 图片上传参数(文件流对应的 media 字段等)
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -24,23 +24,20 @@ use WePayV3\Cert;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付基础类
|
* 微信支付基础类
|
||||||
* Class BasicWePay
|
* @package WePayV3\Contracts
|
||||||
* @package WePayV3
|
|
||||||
*/
|
*/
|
||||||
abstract class BasicWePay
|
abstract class BasicWePay
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* 接口基础地址
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $base = 'https://api.mch.weixin.qq.com';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实例对象静态缓存
|
* 实例对象静态缓存
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected static $cache = [];
|
protected static $cache = [];
|
||||||
|
/**
|
||||||
|
* 接口基础地址
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $base = 'https://api.mch.weixin.qq.com';
|
||||||
/**
|
/**
|
||||||
* 自动配置平台证书
|
* 自动配置平台证书
|
||||||
* @var bool
|
* @var bool
|
||||||
@ -150,6 +147,94 @@ abstract class BasicWePay
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置证书内容
|
||||||
|
* @param string $key 证书ID或序号
|
||||||
|
* @param string $cert 证书文本内容
|
||||||
|
* @return string
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
*/
|
||||||
|
private function withCertContent($key, $cert)
|
||||||
|
{
|
||||||
|
if (substr(trim($cert), 0, 5) == '-----') {
|
||||||
|
$this->config['cert_package'][$key] = $cert;
|
||||||
|
} elseif (file_exists($cert)) {
|
||||||
|
$this->config['cert_package'][$key] = file_get_contents($cert);
|
||||||
|
} else {
|
||||||
|
throw new InvalidResponseException("证书设置失败!");
|
||||||
|
}
|
||||||
|
return $cert;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取支付证书
|
||||||
|
* @return mixed|string
|
||||||
|
*/
|
||||||
|
private function withCertPayment()
|
||||||
|
{
|
||||||
|
foreach ($this->config['cert_package'] as $key => $cert) {
|
||||||
|
if (strpos($key, 'PUB_KEY_ID_') === 0) {
|
||||||
|
if (empty($this->config['mp_cert_serial']) || empty($this->config['mp_cert_content'])) {
|
||||||
|
$this->config['mp_cert_serial'] = $key;
|
||||||
|
$this->config['mp_cert_content'] = $cert;
|
||||||
|
}
|
||||||
|
return $cert;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动配置平台证书
|
||||||
|
* @return void
|
||||||
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
protected function _autoCert()
|
||||||
|
{
|
||||||
|
$certs = $this->tmpFile("{$this->config['mch_id']}_certs");
|
||||||
|
if (is_array($certs)) foreach ($certs as $k => $v) {
|
||||||
|
if ($v['expire'] < time()) unset($certs[$k]);
|
||||||
|
}
|
||||||
|
if (empty($certs)) {
|
||||||
|
Cert::instance($this->config)->download();
|
||||||
|
$certs = $this->tmpFile("{$this->config['mch_id']}_certs");
|
||||||
|
}
|
||||||
|
if (empty($certs) || !is_array($certs)) {
|
||||||
|
throw new InvalidResponseException("读取平台证书失败!");
|
||||||
|
}
|
||||||
|
foreach ($certs as $k => $v) if ($v['expire'] > time() + 10) {
|
||||||
|
$this->config['cert_package'][$k] = $v['content'];
|
||||||
|
if (empty($this->config['mp_cert_serial'])) {
|
||||||
|
$this->config['mp_cert_serial'] = $k;
|
||||||
|
$this->config['mp_cert_content'] = $v['content'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($this->config['cert_package'])) {
|
||||||
|
throw new InvalidResponseException("自动配置平台证书失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写入或读取临时文件
|
||||||
|
* @param string $name
|
||||||
|
* @param null|array|string $content
|
||||||
|
* @param integer $expire
|
||||||
|
* @return array|string
|
||||||
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
*/
|
||||||
|
protected function tmpFile($name, $content = null, $expire = 7200)
|
||||||
|
{
|
||||||
|
if (is_null($content)) {
|
||||||
|
$text = Tools::getCache($name);
|
||||||
|
if (empty($text)) return '';
|
||||||
|
$json = json_decode(Tools::getCache($name) ?: '', true);
|
||||||
|
return isset($json[0]) ? $json[0] : '';
|
||||||
|
} else {
|
||||||
|
return Tools::setCache($name, json_encode([$content], JSON_UNESCAPED_UNICODE), $expire);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 静态创建对象
|
* 静态创建对象
|
||||||
* @param array $config
|
* @param array $config
|
||||||
@ -164,61 +249,6 @@ abstract class BasicWePay
|
|||||||
return self::$cache[$key] = new static($config);
|
return self::$cache[$key] = new static($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 模拟发起请求
|
|
||||||
* @param string $method 请求访问
|
|
||||||
* @param string $pathinfo 请求路由
|
|
||||||
* @param string $jsondata 请求数据
|
|
||||||
* @param boolean $verify 是否验证
|
|
||||||
* @param boolean $isjson 返回JSON
|
|
||||||
* @return array|string
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
*/
|
|
||||||
public function doRequest($method, $pathinfo, $jsondata = '', $verify = false, $isjson = true)
|
|
||||||
{
|
|
||||||
list($time, $nonce) = [time(), uniqid() . rand(1000, 9999)];
|
|
||||||
$signstr = join("\n", [$method, $pathinfo, $time, $nonce, $jsondata, '']);
|
|
||||||
|
|
||||||
// 生成数据签名TOKEN
|
|
||||||
$token = sprintf('mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"',
|
|
||||||
$this->config['mch_id'], $nonce, $time, $this->config['cert_serial'], $this->signBuild($signstr)
|
|
||||||
);
|
|
||||||
$location = (preg_match('|^https?://|', $pathinfo) ? '' : $this->base) . $pathinfo;
|
|
||||||
list($header, $content) = $this->_doRequestCurl($method, $location, [
|
|
||||||
'data' => $jsondata, 'header' => [
|
|
||||||
'Accept: application/json',
|
|
||||||
'Content-Type: application/json',
|
|
||||||
'User-Agent: https://thinkadmin.top',
|
|
||||||
"Authorization: WECHATPAY2-SHA256-RSA2048 {$token}",
|
|
||||||
"Wechatpay-Serial: {$this->config['mp_cert_serial']}"
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($verify) {
|
|
||||||
$headers = [];
|
|
||||||
foreach (explode("\n", $header) as $line) {
|
|
||||||
if (stripos($line, 'Wechatpay') !== false) {
|
|
||||||
list($name, $value) = explode(':', $line);
|
|
||||||
list(, $keys) = explode('wechatpay-', strtolower($name));
|
|
||||||
$headers[$keys] = trim($value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (empty($headers)) {
|
|
||||||
return $isjson ? json_decode($content, true) : $content;
|
|
||||||
}
|
|
||||||
$string = join("\n", [$headers['timestamp'], $headers['nonce'], $content, '']);
|
|
||||||
if (!$this->signVerify($string, $headers['signature'], $headers['serial'])) {
|
|
||||||
throw new InvalidResponseException('验证响应签名失败');
|
|
||||||
}
|
|
||||||
} catch (\Exception $exception) {
|
|
||||||
throw new InvalidResponseException($exception->getMessage(), $exception->getCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $isjson ? json_decode($content, true) : $content;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模拟发起上传请求
|
* 模拟发起上传请求
|
||||||
* @param string $pathinfo 请求路由
|
* @param string $pathinfo 请求路由
|
||||||
@ -295,6 +325,17 @@ abstract class BasicWePay
|
|||||||
return $isjson ? json_decode($content, true) : $content;
|
return $isjson ? json_decode($content, true) : $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成数据签名
|
||||||
|
* @param string $data 签名内容
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function signBuild($data)
|
||||||
|
{
|
||||||
|
$pkeyid = openssl_pkey_get_private($this->config['cert_private']);
|
||||||
|
openssl_sign($data, $signature, $pkeyid, 'sha256WithRSAEncryption');
|
||||||
|
return base64_encode($signature);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过CURL模拟网络请求
|
* 通过CURL模拟网络请求
|
||||||
@ -327,18 +368,6 @@ abstract class BasicWePay
|
|||||||
return [substr($content, 0, $headerSize), substr($content, $headerSize)];
|
return [substr($content, 0, $headerSize), substr($content, $headerSize)];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成数据签名
|
|
||||||
* @param string $data 签名内容
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function signBuild($data)
|
|
||||||
{
|
|
||||||
$pkeyid = openssl_pkey_get_private($this->config['cert_private']);
|
|
||||||
openssl_sign($data, $signature, $pkeyid, 'sha256WithRSAEncryption');
|
|
||||||
return base64_encode($signature);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证内容签名
|
* 验证内容签名
|
||||||
* @param string $data 签名内容
|
* @param string $data 签名内容
|
||||||
@ -392,54 +421,79 @@ abstract class BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动配置平台证书
|
* 通用接口调用(微信支付 V3)
|
||||||
* @return void
|
* @param string $url 完整 URL 或相对路径(如 /v3/pay/transactions/jsapi)
|
||||||
|
* @param array|string $data 请求体,数组自动 JSON,字符串原样发送
|
||||||
|
* @param string $method GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS,默认 POST
|
||||||
|
* @param bool $verify 是否验证返回签名
|
||||||
|
* @return array 解析后的数组
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
|
||||||
*/
|
*/
|
||||||
protected function _autoCert()
|
public function callApi($url, $data = '', $method = 'POST', $verify = false)
|
||||||
{
|
{
|
||||||
$certs = $this->tmpFile("{$this->config['mch_id']}_certs");
|
$method = strtoupper($method);
|
||||||
if (is_array($certs)) foreach ($certs as $k => $v) {
|
|
||||||
if ($v['expire'] < time()) unset($certs[$k]);
|
// 处理数据
|
||||||
}
|
if (is_array($data)) {
|
||||||
if (empty($certs)) {
|
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||||
Cert::instance($this->config)->download();
|
|
||||||
$certs = $this->tmpFile("{$this->config['mch_id']}_certs");
|
|
||||||
}
|
|
||||||
if (empty($certs) || !is_array($certs)) {
|
|
||||||
throw new InvalidResponseException("读取平台证书失败!");
|
|
||||||
}
|
|
||||||
foreach ($certs as $k => $v) if ($v['expire'] > time() + 10) {
|
|
||||||
$this->config['cert_package'][$k] = $v['content'];
|
|
||||||
if (empty($this->config['mp_cert_serial'])) {
|
|
||||||
$this->config['mp_cert_serial'] = $k;
|
|
||||||
$this->config['mp_cert_content'] = $v['content'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (empty($this->config['cert_package'])) {
|
|
||||||
throw new InvalidResponseException("自动配置平台证书失败!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this->doRequest($method, $url, $data, $verify, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 写入或读取临时文件
|
* 模拟发起请求
|
||||||
* @param string $name
|
* @param string $method 请求访问
|
||||||
* @param null|array|string $content
|
* @param string $pathinfo 请求路由
|
||||||
* @param integer $expire
|
* @param string $jsondata 请求数据
|
||||||
|
* @param boolean $verify 是否验证
|
||||||
|
* @param boolean $isjson 返回JSON
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
protected function tmpFile($name, $content = null, $expire = 7200)
|
public function doRequest($method, $pathinfo, $jsondata = '', $verify = false, $isjson = true)
|
||||||
{
|
{
|
||||||
if (is_null($content)) {
|
list($time, $nonce) = [time(), uniqid() . rand(1000, 9999)];
|
||||||
$text = Tools::getCache($name);
|
$signstr = join("\n", [$method, $pathinfo, $time, $nonce, $jsondata, '']);
|
||||||
if (empty($text)) return '';
|
|
||||||
$json = json_decode(Tools::getCache($name) ?: '', true);
|
// 生成数据签名TOKEN
|
||||||
return isset($json[0]) ? $json[0] : '';
|
$token = sprintf('mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"',
|
||||||
} else {
|
$this->config['mch_id'], $nonce, $time, $this->config['cert_serial'], $this->signBuild($signstr)
|
||||||
return Tools::setCache($name, json_encode([$content], JSON_UNESCAPED_UNICODE), $expire);
|
);
|
||||||
|
$location = (preg_match('|^https?://|', $pathinfo) ? '' : $this->base) . $pathinfo;
|
||||||
|
list($header, $content) = $this->_doRequestCurl($method, $location, [
|
||||||
|
'data' => $jsondata, 'header' => [
|
||||||
|
'Accept: application/json',
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'User-Agent: https://thinkadmin.top',
|
||||||
|
"Authorization: WECHATPAY2-SHA256-RSA2048 {$token}",
|
||||||
|
"Wechatpay-Serial: {$this->config['mp_cert_serial']}"
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($verify) {
|
||||||
|
$headers = [];
|
||||||
|
foreach (explode("\n", $header) as $line) {
|
||||||
|
if (stripos($line, 'Wechatpay') !== false) {
|
||||||
|
list($name, $value) = explode(':', $line);
|
||||||
|
list(, $keys) = explode('wechatpay-', strtolower($name));
|
||||||
|
$headers[$keys] = trim($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (empty($headers)) {
|
||||||
|
return $isjson ? json_decode($content, true) : $content;
|
||||||
|
}
|
||||||
|
$string = join("\n", [$headers['timestamp'], $headers['nonce'], $content, '']);
|
||||||
|
if (!$this->signVerify($string, $headers['signature'], $headers['serial'])) {
|
||||||
|
throw new InvalidResponseException('验证响应签名失败');
|
||||||
|
}
|
||||||
|
} catch (\Exception $exception) {
|
||||||
|
throw new InvalidResponseException($exception->getMessage(), $exception->getCode());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $isjson ? json_decode($content, true) : $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -457,41 +511,4 @@ abstract class BasicWePay
|
|||||||
throw new InvalidDecryptException('Rsa Encrypt Error.');
|
throw new InvalidDecryptException('Rsa Encrypt Error.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置证书内容
|
|
||||||
* @param string $key 证书ID或序号
|
|
||||||
* @param string $cert 证书文本内容
|
|
||||||
* @return string
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
|
||||||
*/
|
|
||||||
private function withCertContent($key, $cert)
|
|
||||||
{
|
|
||||||
if (substr(trim($cert), 0, 5) == '-----') {
|
|
||||||
$this->config['cert_package'][$key] = $cert;
|
|
||||||
} elseif (file_exists($cert)) {
|
|
||||||
$this->config['cert_package'][$key] = file_get_contents($cert);
|
|
||||||
} else {
|
|
||||||
throw new InvalidResponseException("证书设置失败!");
|
|
||||||
}
|
|
||||||
return $cert;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取支付证书
|
|
||||||
* @return mixed|string
|
|
||||||
*/
|
|
||||||
private function withCertPayment()
|
|
||||||
{
|
|
||||||
foreach ($this->config['cert_package'] as $key => $cert) {
|
|
||||||
if (strpos($key, 'PUB_KEY_ID_') === 0) {
|
|
||||||
if (empty($this->config['mp_cert_serial']) || empty($this->config['mp_cert_content'])) {
|
|
||||||
$this->config['mp_cert_serial'] = $key;
|
|
||||||
$this->config['mp_cert_content'] = $cert;
|
|
||||||
}
|
|
||||||
return $cert;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -21,16 +21,14 @@ use WeChat\Exceptions\InvalidDecryptException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Aes 解密工具类
|
* Aes 解密工具类
|
||||||
* Class DecryptAes
|
|
||||||
* @package WePayV3\Contracts
|
* @package WePayV3\Contracts
|
||||||
*/
|
*/
|
||||||
class DecryptAes
|
class DecryptAes
|
||||||
{
|
{
|
||||||
|
|
||||||
private $aesKey;
|
|
||||||
|
|
||||||
const KEY_LENGTH_BYTE = 32;
|
const KEY_LENGTH_BYTE = 32;
|
||||||
const AUTH_TAG_LENGTH_BYTE = 16;
|
const AUTH_TAG_LENGTH_BYTE = 16;
|
||||||
|
private $aesKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,8 +20,7 @@ use WeChat\Exceptions\InvalidResponseException;
|
|||||||
use WePayV3\Contracts\BasicWePay;
|
use WePayV3\Contracts\BasicWePay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付代金券
|
* 微信支付代金券 (V3)
|
||||||
* @class Coupon
|
|
||||||
* @package WePayV3
|
* @package WePayV3
|
||||||
*/
|
*/
|
||||||
class Coupon extends BasicWePay
|
class Coupon extends BasicWePay
|
||||||
@ -30,7 +29,7 @@ class Coupon extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建代金券批次
|
* 创建代金券批次
|
||||||
* @param array $data
|
* @param array $data 批次参数(stock_name, belong_merchant 等)
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -83,7 +82,7 @@ class Coupon extends BasicWePay
|
|||||||
* 查询批次详情
|
* 查询批次详情
|
||||||
* @param string $stock_id 批次号
|
* @param string $stock_id 批次号
|
||||||
* @param string $stock_creator_mchid 创建批次的商户号
|
* @param string $stock_creator_mchid 创建批次的商户号
|
||||||
* @return array|string
|
* @return array|string 批次详情
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function stocksDetail($stock_id, $stock_creator_mchid)
|
public function stocksDetail($stock_id, $stock_creator_mchid)
|
||||||
@ -94,7 +93,7 @@ class Coupon extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 代金券批次可用商品
|
* 代金券批次可用商品
|
||||||
* @param array $param
|
* @param array $param 包含 stock_id 等
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -106,7 +105,7 @@ class Coupon extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置消息通知地址
|
* 设置消息通知地址
|
||||||
* @param array $param
|
* @param array $param 回调参数(notify_url, switch 等)
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -117,8 +116,8 @@ class Coupon extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发放代金券批次
|
* 发放代金券
|
||||||
* @param array $param 请求参数
|
* @param array $param 请求参数(openid, stock_id 等)
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -129,9 +128,9 @@ class Coupon extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据商户号查用户的券
|
* 查询用户名下券(按商户号)
|
||||||
* @param array $param 请求参数
|
* @param array $param 请求参数(openid, appid, stock_id 等)
|
||||||
* @return array|string
|
* @return array|string 券列表
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function couponsList(array $param)
|
public function couponsList(array $param)
|
||||||
@ -141,10 +140,10 @@ class Coupon extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询代金券详情
|
* 查询单张代金券详情
|
||||||
* @param string $openid 用户openid
|
* @param string $openid 用户 openid
|
||||||
* @param string $coupon_id 代金券id
|
* @param string $coupon_id 代金券 id
|
||||||
* @param string $appid 公众账号ID
|
* @param string $appid 公众账号或小程序 appid
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -20,15 +20,14 @@ use WeChat\Contracts\Tools;
|
|||||||
use WePayV3\Contracts\BasicWePay;
|
use WePayV3\Contracts\BasicWePay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平台收付通
|
* 收付通(特约/二级商户、合单、分账等)
|
||||||
* @class Ecommerce
|
|
||||||
* @package WePayV3
|
* @package WePayV3
|
||||||
*/
|
*/
|
||||||
class Ecommerce extends BasicWePay
|
class Ecommerce extends BasicWePay
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 提交申请单(商户进件)
|
* 提交进件申请
|
||||||
* @param array $data 进件参数
|
* @param array $data 进件参数(含证件、账户、联系人,敏感字段自动 RSA)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -64,7 +63,7 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过业务申请编号查询申请状态(商户进件)
|
* 按业务申请编号查询进件状态
|
||||||
* @param string $out_request_no 业务申请编号
|
* @param string $out_request_no 业务申请编号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -76,7 +75,7 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过申请单ID查询申请状态(商户进件)
|
* 按申请单 ID 查询进件状态
|
||||||
* @param string $applyment_id 微信支付申请单号
|
* @param string $applyment_id 微信支付申请单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -88,9 +87,9 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改结算账户(商户进件)
|
* 修改结算账户
|
||||||
* @param string $sub_mchid 特约商户/二级商户号
|
* @param string $sub_mchid 特约/二级商户号
|
||||||
* @param array $data 包体参数
|
* @param array $data 账户参数(敏感字段需 RSA)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -101,8 +100,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询结算账户修改申请状态(商户进件)
|
* 查询结算账户修改状态
|
||||||
* @param string $sub_mchid 特约商户/二级商户号
|
* @param string $sub_mchid 特约/二级商户号
|
||||||
* @param string $application_no 修改结算账户申请单号
|
* @param string $application_no 修改结算账户申请单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -115,8 +114,8 @@ class Ecommerce extends BasicWePay
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询结算账户(商户进件)
|
* 查询结算账户
|
||||||
* @param string $sub_mchid 特约商户/二级商户号
|
* @param string $sub_mchid 特约/二级商户号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -127,8 +126,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传文件(商户进件)
|
* 上传进件所需图片/文件
|
||||||
* @param string $filename 文件目录
|
* @param string $filename 本地文件路径
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -138,8 +137,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP下单(普通支付)
|
* 合作方 APP 下单
|
||||||
* @param array $data POST请求参数
|
* @param array $data 下单参数(sp_mchid, sub_mchid, description, out_trade_no, notify_url 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -150,8 +149,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSAPI下单(普通支付)
|
* 合作方 JSAPI 下单
|
||||||
* @param array $data POST请求参数
|
* @param array $data 下单参数(含 payer.openid 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -162,8 +161,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Native下单(普通支付)
|
* 合作方 Native 下单
|
||||||
* @param array $data POST请求参数
|
* @param array $data 下单参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -174,8 +173,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5下单(普通支付)
|
* 合作方 H5 下单
|
||||||
* @param array $data POST请求参数
|
* @param array $data 下单参数(含 scene_info 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -186,9 +185,9 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付订单号查询订单(普通支付)
|
* 订单查询(按微信交易号)
|
||||||
* @param string $transaction_id
|
* @param string $transaction_id 微信订单号
|
||||||
* @param string $sub_mchid
|
* @param string $sub_mchid 二级商户号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -200,9 +199,9 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付商户订单号查询订单(普通支付)
|
* 订单查询(按商户订单号)
|
||||||
* @param string $out_trade_no
|
* @param string $out_trade_no 商户订单号
|
||||||
* @param string $sub_mchid
|
* @param string $sub_mchid 二级商户号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -214,9 +213,9 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭订单(普通支付)
|
* 关闭订单
|
||||||
* @param string $out_trade_no 商户订单号
|
* @param string $out_trade_no 商户订单号
|
||||||
* @param array $data POST请求参数
|
* @param array $data 包含 sub_mchid 等
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -228,8 +227,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSAPI支付(合单下单)
|
* 合单 JSAPI 下单
|
||||||
* @param array $data POST请求参数
|
* @param array $data 合单参数(combine_out_trade_no, sub_orders 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -240,8 +239,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP支付(合单下单)
|
* 合单 APP 下单
|
||||||
* @param array $data POST请求参数
|
* @param array $data 合单参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -252,8 +251,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5支付(合单下单)
|
* 合单 H5 下单
|
||||||
* @param array $data POST请求参数
|
* @param array $data 合单参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -264,8 +263,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Native支付(合单下单)
|
* 合单 Native 下单
|
||||||
* @param array $data POST请求参数
|
* @param array $data 合单参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -276,8 +275,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合单查询(合单支付)
|
* 合单查询
|
||||||
* @param string $combine_out_trade_no
|
* @param string $combine_out_trade_no 合单商户订单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -288,9 +287,9 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合单关单(合单下单)
|
* 合单关单
|
||||||
* @param $combine_out_trade_no
|
* @param string $combine_out_trade_no 合单商户订单号
|
||||||
* @param array $data POST请求参数
|
* @param array $data 包含 sub_orders 等
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -301,8 +300,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求分账(分账)
|
* 电商平台发起分账
|
||||||
* @param array $data POST请求参数
|
* @param array $data 分账参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -313,8 +312,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询分账结果(分账)
|
* 查询分账结果
|
||||||
* @param array $param
|
* @param array $param 查询参数(sub_mchid, transaction_id, out_order_no 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -325,8 +324,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求分账回退(分账)
|
* 请求分账回退
|
||||||
* @param array $data POST请求参数
|
* @param array $data 回退参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -337,8 +336,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询分账回退结果(分账)
|
* 查询分账回退结果
|
||||||
* @param array $param
|
* @param array $param 查询参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -349,8 +348,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完结分账(分账)
|
* 完结分账
|
||||||
* @param array $data POST请求参数
|
* @param array $data 完结参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -361,7 +360,7 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单剩余待分金额(分账)
|
* 查询订单待分金额
|
||||||
* @param string $transaction_id 微信订单号
|
* @param string $transaction_id 微信订单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -373,8 +372,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加分账接收方(分账)
|
* 添加分账接收方
|
||||||
* @param array $data POST请求参数
|
* @param array $data 接收方参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -385,8 +384,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加分账接收方(分账)
|
* 删除分账接收方
|
||||||
* @param array $data POST请求参数
|
* @param array $data 接收方参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -397,8 +396,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求补差(补差)
|
* 请求补差
|
||||||
* @param array $data POST请求参数
|
* @param array $data 补差参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -409,8 +408,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求补差回退(补差)
|
* 补差回退
|
||||||
* @param array $data POST请求参数
|
* @param array $data 回退参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -421,8 +420,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消补差(补差)
|
* 取消补差
|
||||||
* @param array $data POST请求参数
|
* @param array $data 取消参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -433,8 +432,8 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请退款(退款)
|
* 申请退款
|
||||||
* @param array $data POST请求参数
|
* @param array $data 退款参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -445,9 +444,9 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询单笔退款(按商户退款单号)(退款)
|
* 查询单笔退款(按微信退款号)
|
||||||
* @param string $refund_id
|
* @param string $refund_id 微信退款号
|
||||||
* @param string $sub_mchid
|
* @param string $sub_mchid 二级商户号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -458,9 +457,9 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询单笔退款(按商户退款单号)(退款)
|
* 查询单笔退款(按商户退款号)
|
||||||
* @param string $out_refund_no
|
* @param string $out_refund_no 商户退款单号
|
||||||
* @param string $sub_mchid
|
* @param string $sub_mchid 二级商户号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -471,9 +470,9 @@ class Ecommerce extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询垫付回补结果(退款)
|
* 查询垫付回补结果
|
||||||
* @param string $refund_id
|
* @param string $refund_id 微信退款号
|
||||||
* @param string $sub_mchid
|
* @param string $sub_mchid 二级商户号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -485,8 +484,8 @@ class Ecommerce extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 垫付退款回补
|
* 垫付退款回补
|
||||||
* @param string $refund_id
|
* @param string $refund_id 微信退款号
|
||||||
* @param array $data
|
* @param array $data 回补参数
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -24,7 +24,6 @@ use WePayV3\Contracts\DecryptAes;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 直连商户 | 订单支付接口
|
* 直连商户 | 订单支付接口
|
||||||
* Class Order
|
|
||||||
* @package WePayV3
|
* @package WePayV3
|
||||||
*/
|
*/
|
||||||
class Order extends BasicWePay
|
class Order extends BasicWePay
|
||||||
@ -35,10 +34,10 @@ class Order extends BasicWePay
|
|||||||
const WXPAY_NATIVE = 'native';
|
const WXPAY_NATIVE = 'native';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建支付订单
|
* 创建支付订单(V3)
|
||||||
* @param string $type 支付类型
|
* @param string $type 支付类型 h5|app|jsapi|native
|
||||||
* @param array $data 支付参数
|
* @param array $data 支付参数,按各场景必填(appid, mchid, description, out_trade_no, notify_url 等)
|
||||||
* @return array
|
* @return array 预支付结果或前端调起参数
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_1.shtml
|
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_1.shtml
|
||||||
*/
|
*/
|
||||||
@ -78,8 +77,8 @@ class Order extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付订单查询
|
* 支付订单查询
|
||||||
* @param string $tradeNo 订单单号
|
* @param string $tradeNo 商户订单号 out_trade_no
|
||||||
* @return array
|
* @return array 订单详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_2.shtml
|
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_2.shtml
|
||||||
*/
|
*/
|
||||||
@ -91,8 +90,8 @@ class Order extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭支付订单
|
* 关闭支付订单
|
||||||
* @param string $tradeNo 订单单号
|
* @param string $tradeNo 商户订单号 out_trade_no
|
||||||
* @return array
|
* @return array 关闭结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function close($tradeNo)
|
public function close($tradeNo)
|
||||||
@ -103,31 +102,9 @@ class Order extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付通知解析
|
* 创建退款订单(V3)
|
||||||
* @param array|null $data
|
* @param array $data 退款参数(out_trade_no 或 transaction_id,out_refund_no,amount 等)
|
||||||
* @return array
|
* @return array 退款结果
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
|
||||||
*/
|
|
||||||
public function notify($data = [])
|
|
||||||
{
|
|
||||||
if (empty($data)) {
|
|
||||||
$data = json_decode(Tools::getRawInput(), true);
|
|
||||||
}
|
|
||||||
if (isset($data['resource'])) {
|
|
||||||
$aes = new DecryptAes($this->config['mch_v3_key']);
|
|
||||||
$data['result'] = $aes->decryptToString(
|
|
||||||
$data['resource']['associated_data'],
|
|
||||||
$data['resource']['nonce'],
|
|
||||||
$data['resource']['ciphertext']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建退款订单
|
|
||||||
* @param array $data 退款参数
|
|
||||||
* @return array
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_9.shtml
|
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_9.shtml
|
||||||
*/
|
*/
|
||||||
@ -139,8 +116,8 @@ class Order extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款订单查询
|
* 退款订单查询
|
||||||
* @param string $refundNo 退款单号
|
* @param string $refundNo 商户退款单号 out_refund_no
|
||||||
* @return array
|
* @return array 退款详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_10.shtml
|
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_10.shtml
|
||||||
*/
|
*/
|
||||||
@ -162,10 +139,32 @@ class Order extends BasicWePay
|
|||||||
return $this->notify($data);
|
return $this->notify($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付/退款通知解析(自动解密 resource)
|
||||||
|
* @param array|null $data 通知原文,为空则从输入流读取
|
||||||
|
* @return array 解析后的通知数据,包含 result 字段(明文)
|
||||||
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
|
*/
|
||||||
|
public function notify($data = [])
|
||||||
|
{
|
||||||
|
if (empty($data)) {
|
||||||
|
$data = json_decode(Tools::getRawInput(), true);
|
||||||
|
}
|
||||||
|
if (isset($data['resource'])) {
|
||||||
|
$aes = new DecryptAes($this->config['mch_v3_key']);
|
||||||
|
$data['result'] = $aes->decryptToString(
|
||||||
|
$data['resource']['associated_data'],
|
||||||
|
$data['resource']['nonce'],
|
||||||
|
$data['resource']['ciphertext']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请交易账单
|
* 申请交易账单
|
||||||
* @param array|string $params
|
* @param array|string $params 账单参数(bill_date, bill_type 等)或已拼好的查询串
|
||||||
* @return array
|
* @return array 含下载地址的申请结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_6.shtml
|
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_6.shtml
|
||||||
*/
|
*/
|
||||||
@ -177,8 +176,8 @@ class Order extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请资金账单
|
* 申请资金账单
|
||||||
* @param array|string $params
|
* @param array|string $params 账单参数(bill_date, account_type 等)或已拼好的查询串
|
||||||
* @return array
|
* @return array 含下载地址的申请结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_7.shtml
|
* @document https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_7.shtml
|
||||||
*/
|
*/
|
||||||
@ -190,8 +189,8 @@ class Order extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载账单文件
|
* 下载账单文件
|
||||||
* @param string $fileurl
|
* @param string $fileurl 申请账单返回的 download_url
|
||||||
* @return string 二进制 Excel 内容
|
* @return string 二进制内容(gzip/CSV/Excel)
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @document https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_1.shtml
|
* @document https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_1.shtml
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,15 +19,14 @@ namespace WePayV3;
|
|||||||
use WePayV3\Contracts\BasicWePay;
|
use WePayV3\Contracts\BasicWePay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 普通商户商家分账
|
* 商家分账 (V3)
|
||||||
* Class Profitsharing
|
|
||||||
* @package WePayV3
|
* @package WePayV3
|
||||||
*/
|
*/
|
||||||
class ProfitSharing extends BasicWePay
|
class ProfitSharing extends BasicWePay
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 请求分账
|
* 请求分账
|
||||||
* @param array $options
|
* @param array $options 分账参数(transaction_id, out_order_no, receivers 等)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -41,7 +40,7 @@ class ProfitSharing extends BasicWePay
|
|||||||
* 查询分账结果
|
* 查询分账结果
|
||||||
* @param string $outOrderNo 商户分账单号
|
* @param string $outOrderNo 商户分账单号
|
||||||
* @param string $transactionId 微信订单号
|
* @param string $transactionId 微信订单号
|
||||||
* @return array
|
* @return array 分账状态
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function query($outOrderNo, $transactionId)
|
public function query($outOrderNo, $transactionId)
|
||||||
@ -52,7 +51,7 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 解冻剩余资金
|
* 解冻剩余资金
|
||||||
* @param array $options
|
* @param array $options 解冻参数(transaction_id, out_order_no, description)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -64,7 +63,7 @@ class ProfitSharing extends BasicWePay
|
|||||||
/**
|
/**
|
||||||
* 查询剩余待分金额
|
* 查询剩余待分金额
|
||||||
* @param string $transactionId 微信订单号
|
* @param string $transactionId 微信订单号
|
||||||
* @return array
|
* @return array 待分金额
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function amounts($transactionId)
|
public function amounts($transactionId)
|
||||||
@ -75,7 +74,7 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加分账接收方
|
* 添加分账接收方
|
||||||
* @param array $options
|
* @param array $options 接收方信息(type, account, name 等,name 需 RSA)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -91,7 +90,7 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除分账接收方
|
* 删除分账接收方
|
||||||
* @param array $options
|
* @param array $options 接收方信息(type, account)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -103,8 +102,8 @@ class ProfitSharing extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求分账回退
|
* 请求分账回退
|
||||||
* @param array $options
|
* @param array $options 回退参数(out_return_no, out_order_no, return_account 等)
|
||||||
* @return array
|
* @return array 回退结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function backspace(array $options)
|
public function backspace(array $options)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -28,9 +28,9 @@ use WePayV3\Contracts\BasicWePay;
|
|||||||
class Refund extends BasicWePay
|
class Refund extends BasicWePay
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 创建退款订单
|
* 创建退款订单(兼容入口,转调 Order::createRefund)
|
||||||
* @param array $data 退款参数
|
* @param array $data 退款参数(out_trade_no 或 transaction_id,out_refund_no,amount 等)
|
||||||
* @return array
|
* @return array 退款结果
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -41,9 +41,9 @@ class Refund extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款订单查询
|
* 退款订单查询(兼容入口)
|
||||||
* @param string $refundNo 退款单号
|
* @param string $refundNo 商户退款单号 out_refund_no
|
||||||
* @return array
|
* @return array 退款详情
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
*/
|
*/
|
||||||
@ -55,9 +55,9 @@ class Refund extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取退款通知
|
* 获取退款通知(兼容入口,转调 Order::notify)
|
||||||
* @param mixed $xml
|
* @param mixed $xml 通知原文
|
||||||
* @return array
|
* @return array 解密后的通知数据
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -19,16 +19,15 @@ namespace WePayV3;
|
|||||||
use WePayV3\Contracts\BasicWePay;
|
use WePayV3\Contracts\BasicWePay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 普通商户商家转账到零钱
|
* 商家转账到零钱 (V3)
|
||||||
* @class Transfers
|
|
||||||
* @package WePayV3
|
* @package WePayV3
|
||||||
*/
|
*/
|
||||||
class Transfers extends BasicWePay
|
class Transfers extends BasicWePay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新版商家转换到零钱
|
* 商家转账到零钱(单笔)
|
||||||
* @param $body
|
* @param array $body 转账参数(out_bill_no, transfer_amount, openid/user_name 等,敏感字段需 RSA)
|
||||||
* @return array|string
|
* @return array|string
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -47,8 +46,8 @@ class Transfers extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询转账结果
|
* 查询转账结果
|
||||||
* @param $out_bill_no
|
* @param string $out_bill_no 商户转账单号
|
||||||
* @return array|string
|
* @return array|string 转账状态
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
public function billsQuery($out_bill_no)
|
public function billsQuery($out_bill_no)
|
||||||
@ -58,7 +57,7 @@ class Transfers extends BasicWePay
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发起商家批量转账
|
* 发起商家批量转账
|
||||||
* @param array $body
|
* @param array $body 批量参数(out_batch_no, transfer_detail_list 等,姓名需 RSA)
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidDecryptException
|
* @throws \WeChat\Exceptions\InvalidDecryptException
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
@ -84,13 +83,13 @@ class Transfers extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过微信批次单号查询批次单
|
* 查询批量转账批次
|
||||||
* @param string $batchId 微信批次单号(二选一)
|
* @param string $batchId 微信批次单号(二选一)
|
||||||
* @param string $outBatchNo 商家批次单号(二选一)
|
* @param string $outBatchNo 商户批次单号(二选一)
|
||||||
* @param boolean $needQueryDetail 查询指定状态
|
* @param bool $needQueryDetail 是否拉取明细
|
||||||
* @param integer $offset 请求资源的起始位置
|
* @param int $offset 明细起始位置
|
||||||
* @param integer $limit 最大明细条数
|
* @param int $limit 最大明细条数
|
||||||
* @param string $detailStatus 查询指定状态
|
* @param string $detailStatus 明细状态 ALL|SUCCESS|FAIL
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -111,9 +110,9 @@ class Transfers extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过微信明细单号查询明细单
|
* 通过微信明细单号查询明细
|
||||||
* @param string $batchId 微信批次单号
|
* @param string $batchId 微信批次单号
|
||||||
* @param string $detailId 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识
|
* @param string $detailId 微信明细单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
@ -124,9 +123,9 @@ class Transfers extends BasicWePay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过商家明细单号查询明细单
|
* 通过商家明细单号查询明细
|
||||||
* @param string $outBatchNo 商户系统内部的商家批次单号,在商户系统内部唯一
|
* @param string $outBatchNo 商户批次单号
|
||||||
* @param string $outDetailNo 商户系统内部区分转账批次单下不同转账明细单的唯一标识
|
* @param string $outDetailNo 商户明细单号
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -32,7 +32,7 @@ try {
|
|||||||
'total_amount' => '1', // 支付金额
|
'total_amount' => '1', // 支付金额
|
||||||
'subject' => '支付宝订单标题', // 支付订单描述
|
'subject' => '支付宝订单标题', // 支付订单描述
|
||||||
]);
|
]);
|
||||||
echo $result . PHP_EOL .'<br></br>'. PHP_EOL;
|
echo $result . PHP_EOL . '<br></br>' . PHP_EOL;
|
||||||
|
|
||||||
// 请求关闭订单
|
// 请求关闭订单
|
||||||
$result = $pay->close([
|
$result = $pay->close([
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
163
_test/alipay-callapi-test.php
Normal file
163
_test/alipay-callapi-test.php
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | WeChatDeveloper
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网站: https://thinkadmin.top
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 开源协议 ( https://mit-license.org )
|
||||||
|
// | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
|
||||||
|
// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝通用接口测试
|
||||||
|
* 测试 callApi() 万能接口方法
|
||||||
|
*/
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
// 1. 手动加载入口文件
|
||||||
|
include "../include.php";
|
||||||
|
|
||||||
|
// 2. 准备支付宝配置参数
|
||||||
|
$config = include "./alipay.php";
|
||||||
|
|
||||||
|
// 3. 创建接口实例
|
||||||
|
$alipay = \We::AliPayWeb($config);
|
||||||
|
|
||||||
|
echo "<h2>=== 支付宝通用接口测试 ===</h2>";
|
||||||
|
|
||||||
|
// ============================================
|
||||||
|
// 测试1: GET请求 - 查询订单
|
||||||
|
// ============================================
|
||||||
|
echo "<h3>测试1: GET请求 - 查询订单</h3>";
|
||||||
|
try {
|
||||||
|
$result = $alipay->callApi(
|
||||||
|
'alipay.trade.query', // API方法名(必填,第一参数)
|
||||||
|
[
|
||||||
|
'out_trade_no' => time() - 3600, // 使用一个可能存在的订单号
|
||||||
|
],
|
||||||
|
'GET',
|
||||||
|
false // 不验证响应签名
|
||||||
|
);
|
||||||
|
echo '<pre>';
|
||||||
|
var_export($result);
|
||||||
|
echo '</pre>';
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "错误: " . $e->getMessage() . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================
|
||||||
|
// 测试2: GET请求 - 查询订单(验证签名)
|
||||||
|
// ============================================
|
||||||
|
echo "<h3>测试2: GET请求 - 查询订单(验证签名)</h3>";
|
||||||
|
try {
|
||||||
|
$result = $alipay->callApi(
|
||||||
|
'alipay.trade.query', // API方法名
|
||||||
|
[
|
||||||
|
'out_trade_no' => time() - 3600,
|
||||||
|
],
|
||||||
|
'GET',
|
||||||
|
true // 验证响应签名
|
||||||
|
);
|
||||||
|
echo '<pre>';
|
||||||
|
var_export($result);
|
||||||
|
echo '</pre>';
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "错误: " . $e->getMessage() . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================
|
||||||
|
// 测试3: POST请求 - 订单退款
|
||||||
|
// ============================================
|
||||||
|
echo "<h3>测试3: POST请求 - 订单退款</h3>";
|
||||||
|
echo "<p style='color: orange;'>注意:此测试需要有效的订单号</p>";
|
||||||
|
try {
|
||||||
|
$result = $alipay->callApi(
|
||||||
|
'alipay.trade.refund', // API方法名(第一参数)
|
||||||
|
[
|
||||||
|
'out_trade_no' => time() - 3600,
|
||||||
|
'refund_amount' => '0.01',
|
||||||
|
],
|
||||||
|
'POST',
|
||||||
|
false // 不验证响应签名
|
||||||
|
);
|
||||||
|
echo '<pre>';
|
||||||
|
var_export($result);
|
||||||
|
echo '</pre>';
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "错误: " . $e->getMessage() . PHP_EOL;
|
||||||
|
echo "<p style='color: gray;'>这是正常的,因为退款需要有效的订单号</p>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================
|
||||||
|
// 测试4: GET请求 - 退款查询
|
||||||
|
// ============================================
|
||||||
|
echo "<h3>测试4: GET请求 - 退款查询</h3>";
|
||||||
|
try {
|
||||||
|
$result = $alipay->callApi(
|
||||||
|
'alipay.trade.fastpay.refund.query', // API方法名
|
||||||
|
[
|
||||||
|
'out_trade_no' => time() - 3600,
|
||||||
|
'out_request_no' => time() - 3600,
|
||||||
|
],
|
||||||
|
'GET',
|
||||||
|
false // 不验证响应签名
|
||||||
|
);
|
||||||
|
echo '<pre>';
|
||||||
|
var_export($result);
|
||||||
|
echo '</pre>';
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "错误: " . $e->getMessage() . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================
|
||||||
|
// 测试5: POST请求 - 关闭订单
|
||||||
|
// ============================================
|
||||||
|
echo "<h3>测试5: POST请求 - 关闭订单</h3>";
|
||||||
|
try {
|
||||||
|
$result = $alipay->callApi(
|
||||||
|
'alipay.trade.close', // API方法名
|
||||||
|
[
|
||||||
|
'out_trade_no' => time() - 3600,
|
||||||
|
],
|
||||||
|
'POST',
|
||||||
|
false // 不验证响应签名
|
||||||
|
);
|
||||||
|
echo '<pre>';
|
||||||
|
var_export($result);
|
||||||
|
echo '</pre>';
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "错误: " . $e->getMessage() . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================================
|
||||||
|
// 测试6: PUT请求 - 更新资源(示例)
|
||||||
|
// ============================================
|
||||||
|
echo "<h3>测试6: PUT请求 - 更新资源(示例)</h3>";
|
||||||
|
echo "<p style='color: gray;'>注意:此示例仅展示PUT请求用法,实际API可能不支持</p>";
|
||||||
|
try {
|
||||||
|
// PUT请求示例(如果API支持)
|
||||||
|
// $result = $alipay->callApi(
|
||||||
|
// 'alipay.some.method', // API方法名
|
||||||
|
// ['key' => 'value'],
|
||||||
|
// 'PUT',
|
||||||
|
// false
|
||||||
|
// );
|
||||||
|
echo '<pre>PUT请求用法示例(已注释)</pre>';
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "错误: " . $e->getMessage() . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<h3 style='color: green;'>=== 所有测试完成 ===</h3>";
|
||||||
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
// 出错啦,处理下吧
|
||||||
|
echo "<h3 style='color: red;'>错误: " . $e->getMessage() . "</h3>";
|
||||||
|
echo "<pre>" . $e->getTraceAsString() . "</pre>";
|
||||||
|
}
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | WeChatDeveloper
|
// | WeChatDeveloper
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
|
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 官方网站: https://thinkadmin.top
|
// | 官方网站: https://thinkadmin.top
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user