|
|
@@ -8,7 +8,6 @@ use linslin\yii2\curl;
|
|
|
|
|
|
/**
|
|
|
* 微信小程序发货信息管理服务-核心接口工具类
|
|
|
- * 仅封装图片中列出的接口,风格参考 expressUtil.php
|
|
|
*/
|
|
|
class shippingUtil
|
|
|
{
|
|
|
@@ -19,12 +18,11 @@ class shippingUtil
|
|
|
|
|
|
/**
|
|
|
* 发货信息录入接口
|
|
|
- * https://api.weixin.qq.com/wxa/sec/order/shipping?access_token=ACCESS_TOKEN
|
|
|
*/
|
|
|
public static function shipping($merchant, $data, $ptStyle = 0)
|
|
|
{
|
|
|
$accessToken = self::getAccessToken($merchant, $ptStyle);
|
|
|
- $url = "https://api.weixin.qq.com/wxa/sec/order/shipping?access_token={$accessToken}";
|
|
|
+ $url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token={$accessToken}";
|
|
|
$curl = new curl\Curl();
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
return Json::decode($result);
|
|
|
@@ -32,12 +30,11 @@ class shippingUtil
|
|
|
|
|
|
/**
|
|
|
* 发货信息合单录入接口
|
|
|
- * https://api.weixin.qq.com/wxa/sec/order/shippingcombine?access_token=ACCESS_TOKEN
|
|
|
*/
|
|
|
public static function shippingCombine($merchant, $data, $ptStyle = 0)
|
|
|
{
|
|
|
$accessToken = self::getAccessToken($merchant, $ptStyle);
|
|
|
- $url = "https://api.weixin.qq.com/wxa/sec/order/shippingcombine?access_token={$accessToken}";
|
|
|
+ $url = "https://api.weixin.qq.com/wxa/sec/order/upload_combined_shipping_info?access_token={$accessToken}";
|
|
|
$curl = new curl\Curl();
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
return Json::decode($result);
|
|
|
@@ -45,12 +42,11 @@ class shippingUtil
|
|
|
|
|
|
/**
|
|
|
* 查询订单发货状态
|
|
|
- * https://api.weixin.qq.com/wxa/sec/order/getshippinginfo?access_token=ACCESS_TOKEN
|
|
|
*/
|
|
|
public static function getShippingInfo($merchant, $data, $ptStyle = 0)
|
|
|
{
|
|
|
$accessToken = self::getAccessToken($merchant, $ptStyle);
|
|
|
- $url = "https://api.weixin.qq.com/wxa/sec/order/getshippinginfo?access_token={$accessToken}";
|
|
|
+ $url = "https://api.weixin.qq.com/wxa/sec/order/get_order?access_token={$accessToken}";
|
|
|
$curl = new curl\Curl();
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
return Json::decode($result);
|
|
|
@@ -58,12 +54,11 @@ class shippingUtil
|
|
|
|
|
|
/**
|
|
|
* 查询订单列表
|
|
|
- * https://api.weixin.qq.com/wxa/sec/order/getorderlist?access_token=ACCESS_TOKEN
|
|
|
*/
|
|
|
public static function getOrderList($merchant, $data, $ptStyle = 0)
|
|
|
{
|
|
|
$accessToken = self::getAccessToken($merchant, $ptStyle);
|
|
|
- $url = "https://api.weixin.qq.com/wxa/sec/order/getorderlist?access_token={$accessToken}";
|
|
|
+ $url = "https://api.weixin.qq.com/wxa/sec/order/get_order_list?access_token={$accessToken}";
|
|
|
$curl = new curl\Curl();
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
return Json::decode($result);
|
|
|
@@ -71,12 +66,11 @@ class shippingUtil
|
|
|
|
|
|
/**
|
|
|
* 确认收货提醒接口
|
|
|
- * https://api.weixin.qq.com/wxa/sec/order/confirmreceivemsg?access_token=ACCESS_TOKEN
|
|
|
*/
|
|
|
public static function confirmReceiveMsg($merchant, $data, $ptStyle = 0)
|
|
|
{
|
|
|
$accessToken = self::getAccessToken($merchant, $ptStyle);
|
|
|
- $url = "https://api.weixin.qq.com/wxa/sec/order/confirmreceivemsg?access_token={$accessToken}";
|
|
|
+ $url = "https://api.weixin.qq.com/wxa/sec/order/notify_confirm_receive?access_token={$accessToken}";
|
|
|
$curl = new curl\Curl();
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
return Json::decode($result);
|
|
|
@@ -84,12 +78,11 @@ class shippingUtil
|
|
|
|
|
|
/**
|
|
|
* 消息跳转路径设置接口
|
|
|
- * https://api.weixin.qq.com/wxa/sec/order/setmsgjump?access_token=ACCESS_TOKEN
|
|
|
*/
|
|
|
public static function setMsgJump($merchant, $data, $ptStyle = 0)
|
|
|
{
|
|
|
$accessToken = self::getAccessToken($merchant, $ptStyle);
|
|
|
- $url = "https://api.weixin.qq.com/wxa/sec/order/setmsgjump?access_token={$accessToken}";
|
|
|
+ $url = "https://api.weixin.qq.com/wxa/sec/order/set_msg_jump_path?access_token={$accessToken}";
|
|
|
$curl = new curl\Curl();
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
return Json::decode($result);
|
|
|
@@ -119,15 +112,8 @@ class shippingUtil
|
|
|
return Json::decode($result);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 相关消息推送(无需主动调用,文档留档)
|
|
|
- * 仅做占位说明
|
|
|
- */
|
|
|
- // public static function messagePush() {}
|
|
|
-
|
|
|
/**
|
|
|
* 特殊发货报备
|
|
|
- * https://api.weixin.qq.com/wxa/sec/order/opspecialorder?access_token=ACCESS_TOKEN
|
|
|
*/
|
|
|
public static function opSpecialOrder($merchant, $data, $ptStyle = 0)
|
|
|
{
|