Conditions | 1 |
Paths | 1 |
Total Lines | 28 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
30 | 1 | public function cancelTransaction(array $params) |
|
31 | { |
||
32 | $supportedParams = [ |
||
33 | 1 | 'link_id' => $this->options['link_id'], |
|
34 | 1 | 'cust_order_no' => null, |
|
35 | 1 | 'order_amount' => null, |
|
36 | 1 | 'send_time' => Carbon::now(static::TIMEZONE)->toDateTimeString(), |
|
37 | /* |
||
38 | * 回傳方式 |
||
39 | * redirect(直接重新導向)、 |
||
40 | * plain(純文字)、 |
||
41 | * xml(XML 格 式)、 |
||
42 | * json(JSON 格式)。 |
||
43 | */ |
||
44 | 1 | 'return_type' => 'json', |
|
45 | 1 | ]; |
|
46 | |||
47 | 1 | $params = array_filter(array_replace( |
|
48 | 1 | $supportedParams, |
|
49 | 1 | array_intersect_key($params, $supportedParams) |
|
50 | 1 | )); |
|
51 | |||
52 | 1 | $params['chk'] = $this->calculateHash($params, [ |
|
53 | 1 | 'cust_order_no', 'order_amount', 'send_time', |
|
54 | 1 | ]); |
|
55 | |||
56 | 1 | return $this->doRequest('GET', $params, 'cancel'); |
|
57 | } |
||
58 | } |
||
59 |