WeChatDeveloper/WeMini/Shopping.php
2025-03-18 11:51:28 +08:00

95 lines
3.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | WeChatDeveloper
// +----------------------------------------------------------------------
// | 版权所有 2014~2025 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
// +----------------------------------------------------------------------
namespace WeMini;
use WeChat\Contracts\BasicWeChat;
/**
* 小程序购物订单
* Class Shopping
* @package WeMini
*/
class Shopping extends BasicWeChat
{
/**
* 上传购物详情
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function uploadShoppingInfo($data)
{
$url = 'https://api.weixin.qq.com/user-order/orders?access_token=ACCESS_TOKEN';
return $this->callPostApi($url, $data, true);
}
/**
* 上传物流信息
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function uploadShippingInfo($data)
{
$url = 'https://api.weixin.qq.com/user-order/orders?access_token=ACCESS_TOKEN';
return $this->callPostApi($url, $data, true);
}
/**
* 上传合单购物详情
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function uploadCombinedShoppingInfo($data)
{
$url = 'https://api.weixin.qq.com/user-order/orders?access_token=ACCESS_TOKEN';
return $this->callPostApi($url, $data, true);
}
/**
* 上传合单物流信息
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function uploadCombinedShippingInfo($data)
{
$url = 'https://api.weixin.qq.com/user-order/orders?access_token=ACCESS_TOKEN';
return $this->callPostApi($url, $data, true);
}
/**
* 验证购物订单上传结果
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function ShoppingInfoVerifyUploadResult($data)
{
$url = 'https://api.weixin.qq.com/user-order/shoppinginfo/verify?access_token=ACCESS_TOKEN';
return $this->callPostApi($url, $data, true);
}
}