Skip to content

Commit

Permalink
小程序发货信息管理服务 (#2773)
Browse files Browse the repository at this point in the history
* 小程序发货信息管理服务

* 小程序发货信息管理服务

* 小程序发货信息管理服务
  • Loading branch information
fireqong committed Dec 15, 2023
1 parent 1c31e82 commit 52921f3
Show file tree
Hide file tree
Showing 11 changed files with 394 additions and 77 deletions.
2 changes: 2 additions & 0 deletions src/MiniProgram/Application.php
Expand Up @@ -105,6 +105,8 @@ class Application extends ServiceContainer
Shop\Delivery\ServiceProvider::class,
Shop\Aftersale\ServiceProvider::class,
Business\ServiceProvider::class,

Shipping\ServiceProvider::class,
];

/**
Expand Down
2 changes: 1 addition & 1 deletion src/MiniProgram/Base/Client.php
Expand Up @@ -35,7 +35,7 @@ public function getPaidUnionid($openid, $options = [])
{
return $this->httpGet('wxa/getpaidunionid', compact('openid') + $options);
}

/**
* Get version info
*
Expand Down
140 changes: 140 additions & 0 deletions src/MiniProgram/Shipping/Client.php
@@ -0,0 +1,140 @@
<?php

namespace EasyWeChat\MiniProgram\Shipping;

use EasyWeChat\Kernel\BaseClient;

class Client extends BaseClient
{
/**
* 发货信息录入接口
*
* @param array $params
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function uploadShippingInfo(array $params)
{
return $this->httpPostJson('wxa/sec/order/upload_shipping_info', $params);
}

/**
* 发货信息合单录入接口
*
* @param array $params
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function uploadCombineShippingInfo(array $params)
{
return $this->httpPostJson('wxa/sec/order/upload_combined_shipping_info', $params);
}


/**
* 查询订单发货状态
*
* @param array $params
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getOrder(array $params)
{
return $this->httpPostJson('wxa/sec/order/get_order', $params);
}

/**
* 查询订单列表
*
* @param array $params
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getOrderList(array $params = [])
{
return $this->httpPostJson('wxa/sec/order/get_order_list', $params);
}

/**
* 确认收货提醒接口
*
* @param array $params
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function notifyConfirmReceive(array $params)
{
return $this->httpPostJson('wxa/sec/order/notify_confirm_receive', $params);
}

/**
* 消息跳转路径设置接口
*
* @param string $path
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function setMsgJumpPath(string $path)
{
$params = [
'path' => $path
];

return $this->httpPostJson('wxa/sec/order/set_msg_jump_path', $params);
}

/**
* 查询小程查询小程序是否已开通发货信息管理服务
*
* @param string $appID
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function isTradeManaged(string $appID = '')
{
$params = [
'appid' => empty($appID) ? $this->app['config']['app_id'] : $appID
];

return $this->httpPostJson('wxa/sec/order/is_trade_managed', $params);
}

/**
* 查询小程序是否已完成交易结算管理确认
*
* @param string $appID
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function isTradeCompleted(string $appID = '')
{
$params = [
'appid' => empty($appID) ? $this->app['config']['app_id'] : $appID
];

return $this->httpPostJson('wxa/sec/order/is_trade_management_confirmation_completed', $params);
}
}
16 changes: 16 additions & 0 deletions src/MiniProgram/Shipping/ServiceProvider.php
@@ -0,0 +1,16 @@
<?php

namespace EasyWeChat\MiniProgram\Shipping;

use Pimple\Container;
use Pimple\ServiceProviderInterface;

class ServiceProvider implements ServiceProviderInterface
{
public function register(Container $app)
{
$app['shipping'] = function ($app) {
return new Client($app);
};
}
}
9 changes: 4 additions & 5 deletions src/Work/Wedrive/Client.php
Expand Up @@ -15,21 +15,20 @@

/**
* Class Client
*
*
* @author lio990527 <lio990527@163.com>
*/
class Client extends BaseClient
{

/**
* 获取盘专业版信息
*
*
* @param string $userid
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*
*
* @see https://developer.work.weixin.qq.com/document/path/95856#%E8%8E%B7%E5%8F%96%E7%9B%98%E4%B8%93%E4%B8%9A%E7%89%88%E4%BF%A1%E6%81%AF
*/
public function proInfo($userid)
Expand All @@ -44,7 +43,7 @@ public function proInfo($userid)
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*
*
* @see https://developer.work.weixin.qq.com/document/path/95856#%E8%8E%B7%E5%8F%96%E7%9B%98%E5%AE%B9%E9%87%8F%E4%BF%A1%E6%81%AF
*/
public function capacity()
Expand Down

0 comments on commit 52921f3

Please sign in to comment.