ShopifyServiceInterface.php 2.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 12
use Meibuyu\Micro\Exceptions\HttpResponseException;

13 14 15 16 17 18 19 20 21 22 23 24
interface ShopifyServiceInterface
{

    /**
     * 拉取一个shopify订单数据
     * @param $orderId
     * @param $shopifySiteId
     * @return array
     * @throws \Exception
     */
    public function pullOrder($orderId, $shopifySiteId): array;

25 26 27 28 29 30 31 32 33
    /**
     * 通过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;

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

    /**
     * 更新shopify订单
     * @param int $orderId 订单id
     * @param array $params 更新的数据
     * @param int $shopifySiteId shopify站点id
     * @return mixed
     * @throws \Exception
     * @author Zero
     */
    public function updateOrder($orderId, $params, $shopifySiteId);

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

69
}