Passed
Push — master ( be4655...e9d8d4 )
by Carlos
03:27
created

GiftCardOrderClient   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 56
rs 10
ccs 13
cts 13
cp 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A list() 0 11 1
A refund() 0 7 1
A get() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyWeChat\OfficialAccount\Card;
13
14
use EasyWeChat\Kernel\BaseClient;
15
16
/**
17
 * Class GiftCardOrderClient.
18
 *
19
 * @author overtrue <[email protected]>
20
 */
21
class GiftCardOrderClient extends BaseClient
22
{
23
    /**
24
     * 查询-单个礼品卡订单信息接口.
25
     *
26
     * @param string $orderId
27
     *
28
     * @return mixed
29
     */
30 1
    public function get(string $orderId)
31
    {
32
        $params = [
33 1
            'order_id' => $orderId,
34
        ];
35
36 1
        return $this->httpPostJson('card/giftcard/order/get', $params);
37
    }
38
39
    /**
40
     * 查询-批量查询礼品卡订单信息接口.
41
     *
42
     * @param int    $beginTime
43
     * @param int    $endTime
44
     * @param int    $offset
45
     * @param int    $count
46
     * @param string $sortType
47
     *
48
     * @return mixed
49
     */
50 1
    public function list(int $beginTime, int $endTime, int $offset = 0, int $count = 10, string $sortType = 'ASC')
51
    {
52
        $params = [
53 1
            'begin_time' => $beginTime,
54 1
            'end_time' => $endTime,
55 1
            'sort_type' => $sortType,
56 1
            'offset' => $offset,
57 1
            'count' => $count,
58
        ];
59
60 1
        return $this->httpPostJson('card/giftcard/order/batchget', $params);
61
    }
62
63
    /**
64
     * 退款接口.
65
     *
66
     * @param string $orderId
67
     *
68
     * @return mixed
69
     */
70 1
    public function refund(string $orderId)
71
    {
72
        $params = [
73 1
            'order_id' => $orderId,
74
        ];
75
76 1
        return $this->httpPostJson('card/giftcard/order/refund', $params);
77
    }
78
}
79