ShopifyServiceInterface.php 3.02 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
<?php
/**
 * Created by PhpStorm.
 * User: Zero
 * Date: 2020/10/12
 * Time: 9:39
 */

namespace Meibuyu\Micro\Service\Interfaces\Product;

王源's avatar
王源 committed
11
use Exception;
12
use Meibuyu\Micro\Exceptions\RpcException;
王源's avatar
王源 committed
13

王源's avatar
王源 committed
14 15 16 17
/**
 * @deprecated 此接口废弃,在之后的版本会被删除
 * 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\ShopifyServiceInterface
 */
18 19 20 21 22 23 24 25
interface ShopifyServiceInterface
{

    /**
     * 拉取一个shopify订单数据
     * @param $orderId
     * @param $shopifySiteId
     * @return array
王源's avatar
王源 committed
26
     * @throws Exception
27 28 29
     */
    public function pullOrder($orderId, $shopifySiteId): array;

30 31 32 33 34 35 36 37 38
    /**
     * 通过id列表获取shopify站点数组
     * @param array $ids shopify站点id数组,默认去重
     * @param array $columns shopify站点表字段,默认['name', 'prefix', 'team_id', 'site_id', 'language_id', 'url', 'currency_id']
     * @return array 默认keyBy('id')
     * @author Zero
     */
    public function getShopifySitesByIds(array $ids, $columns = ['name', 'prefix', 'team_id', 'site_id', 'language_id', 'url', 'currency_id']): array;

39 40 41 42 43
    /**
     * 拉取传入的id之后的shopify订单列表数据,默认50条数据
     * @param int $sinceId 订单id
     * @param int $shopifySiteId shopify站点id
     * @return array
王源's avatar
王源 committed
44
     * @throws Exception
45 46 47 48 49 50 51 52 53 54
     * @author Zero
     */
    public function pullOrderList($sinceId, $shopifySiteId): array;

    /**
     * 更新shopify订单
     * @param int $orderId 订单id
     * @param array $params 更新的数据
     * @param int $shopifySiteId shopify站点id
     * @return mixed
王源's avatar
王源 committed
55 56
     * @throws RpcException
     * @author zero
57 58 59
     */
    public function updateOrder($orderId, $params, $shopifySiteId);

60
    /**
王源's avatar
王源 committed
61
     * 创建shopify订单发货记录
王源's avatar
王源 committed
62 63
     * 参数示例: https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillment#create-2020-07
     * location_id不传会默认拿取系统有的数据,拿不到报错
64 65
     * @param int $orderId
     * @param array $params
66 67
     * @param int $shopifySiteId
     * @return mixed
68 69
     * @throws RpcException
     * @author zero
70 71 72
     */
    public function createOrderFulfillment($orderId, $params, $shopifySiteId);

73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
    /**
     * 更新shopify订单发货物流信息
     * 参数示例: https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillment#update_tracking-2020-07
     * [
     *   "notify_customer" => true,
     *   "tracking_info" => [
     *     "number" => "1111",
     *     "url" => "http://www.my-url.com",
     *     "company" => "my-company",
     *    ]
     * ]
     * @param $fulfillmentId
     * @param $params
     * @param $shopifySiteId
     * @return array
     * @throws RpcException
     * @author zero
     */
    public function updateFulfillmentTracking($fulfillmentId, $params, $shopifySiteId);

93 94 95 96 97 98 99 100 101
    /**
     * 通过id数组获取shopify的location数据
     * @param $ids
     * @param string[] $columns
     * @return array 默认keyBy('id')
     * @author zero
     */
    public function getLocationsByIds($ids, $columns = ['*']);

102
}