Coupons   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 105
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 105
rs 10
c 1
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A abandon() 0 3 1
A cancelVerify() 0 3 1
A verifyV2() 0 3 1
A syncV2() 0 3 1
A list() 0 3 1
A certVerifyUpdate() 0 3 1
A extendCertValidEndByOrder() 0 3 1
1
<?php
2
3
namespace Abbotton\DouDian\Api;
4
5
use Illuminate\Http\Client\RequestException;
6
use Psr\SimpleCache\InvalidArgumentException;
7
8
class Coupons extends BaseRequest
9
{
10
    /**
11
     * 卡券取消核销接口.
12
     *
13
     * @param array $params
14
     *
15
     * @throws RequestException
16
     * @throws InvalidArgumentException
17
     *
18
     * @return array
19
     */
20
    public function cancelVerify(array $params): array
21
    {
22
        return $this->httpPost('coupons/cancelVerify', $params);
23
    }
24
25
    /**
26
     * 卡券废弃接口.
27
     *
28
     * @param array $params
29
     *
30
     * @throws RequestException
31
     * @throws InvalidArgumentException
32
     *
33
     * @return array
34
     */
35
    public function abandon(array $params): array
36
    {
37
        return $this->httpPost('coupons/abandon', $params);
38
    }
39
40
    /**
41
     * 卡券同步.
42
     *
43
     * @param array $params
44
     *
45
     * @throws RequestException
46
     * @throws InvalidArgumentException
47
     *
48
     * @return array
49
     */
50
    public function syncV2(array $params): array
51
    {
52
        return $this->httpPost('coupons/syncV2', $params);
53
    }
54
55
    /**
56
     * 卡券核销接口V2版本.
57
     *
58
     * @param array $params
59
     *
60
     * @throws RequestException
61
     * @throws InvalidArgumentException
62
     *
63
     * @return array
64
     */
65
    public function verifyV2(array $params): array
66
    {
67
        return $this->httpPost('coupons/verifyV2', $params);
68
    }
69
70
    /**
71
     * 卡券核销次数更新.
72
     *
73
     * @param array $params
74
     *
75
     * @throws RequestException
76
     * @throws InvalidArgumentException
77
     *
78
     * @return array
79
     */
80
    public function certVerifyUpdate(array $params): array
81
    {
82
        return $this->httpPost('coupons/certVerifyUpdate', $params);
83
    }
84
85
    /**
86
     * 三方卡券列表查询.
87
     *
88
     * @param  array  $params
89
     *
90
     * @return array
91
     * @throws InvalidArgumentException
92
     *
93
     * @throws RequestException
94
     */
95
    public function list(array $params): array
96
    {
97
        return $this->httpPost('coupons/list', $params);
98
    }
99
100
    /**
101
     * 三方卡券延期.
102
     *
103
     * @param  array  $params
104
     *
105
     * @return array
106
     * @throws InvalidArgumentException
107
     *
108
     * @throws RequestException
109
     */
110
    public function extendCertValidEndByOrder(array $params): array
111
    {
112
        return $this->httpPost('coupons/extendCertValidEndByOrder', $params);
113
    }
114
}
115