File tree Expand file tree Collapse file tree 11 files changed +25
-23
lines changed Expand file tree Collapse file tree 11 files changed +25
-23
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ public function getDefaultParameters()
44
44
}
45
45
46
46
/**
47
- * @param array $options
48
47
* @return RequestInterface
49
48
*/
50
49
public function purchase (array $ options = [])
@@ -53,7 +52,6 @@ public function purchase(array $options = [])
53
52
}
54
53
55
54
/**
56
- * @param array $options
57
55
* @return RequestInterface
58
56
*/
59
57
public function completePurchase (array $ options = [])
@@ -62,7 +60,6 @@ public function completePurchase(array $options = [])
62
60
}
63
61
64
62
/**
65
- * @param array $options
66
63
* @return RequestInterface|NotificationInterface
67
64
*/
68
65
public function acceptNotification (array $ options = [])
@@ -71,7 +68,6 @@ public function acceptNotification(array $options = [])
71
68
}
72
69
73
70
/**
74
- * @param array $options
75
71
* @return RequestInterface
76
72
*/
77
73
public function fetchTransaction (array $ options = [])
@@ -80,7 +76,6 @@ public function fetchTransaction(array $options = [])
80
76
}
81
77
82
78
/**
83
- * @param array $options
84
79
* @return RequestInterface
85
80
*/
86
81
public function refund (array $ options = [])
Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ public function sendData($data)
58
58
}
59
59
60
60
/**
61
- * @param $data
62
61
* @return array
63
62
*
64
63
* @throws RtnException
Original file line number Diff line number Diff line change 6
6
use Omnipay \Common \Exception \InvalidRequestException ;
7
7
use Omnipay \Common \Message \AbstractRequest ;
8
8
use Omnipay \ECPay \Item ;
9
+ use Omnipay \ECPay \Traits \HasAmount ;
9
10
use Omnipay \ECPay \Traits \HasATMFields ;
10
11
use Omnipay \ECPay \Traits \HasATMOrCVSOrBARCODEFields ;
11
12
use Omnipay \ECPay \Traits \HasCreditFields ;
@@ -32,6 +33,7 @@ class PurchaseRequest extends AbstractRequest
32
33
use HasATMFields;
33
34
use HasCVSOrBARCODEFields;
34
35
use HasATMOrCVSOrBARCODEFields;
36
+ use HasAmount;
35
37
36
38
protected $ liveEndpoint = 'https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5 ' ;
37
39
@@ -125,12 +127,14 @@ private function prepareItems()
125
127
$ currency = $ this ->getCurrency () ?: 'TWD ' ;
126
128
127
129
if (! $ items ) {
128
- return [new Item ([
129
- 'Name ' => $ this ->getDescription (),
130
- 'Price ' => $ this ->getAmount (),
131
- 'Currency ' => $ currency ,
132
- 'Quantity ' => 1 ,
133
- ])];
130
+ return [
131
+ new Item ([
132
+ 'Name ' => $ this ->getDescription (),
133
+ 'Price ' => $ this ->getAmount (),
134
+ 'Currency ' => $ currency ,
135
+ 'Quantity ' => 1 ,
136
+ ]),
137
+ ];
134
138
}
135
139
136
140
return array_map (static function ($ item ) use ($ currency ) {
Original file line number Diff line number Diff line change 4
4
5
5
use Ecpay \Sdk \Exceptions \RtnException ;
6
6
use Omnipay \Common \Message \AbstractRequest ;
7
+ use Omnipay \ECPay \Traits \HasAmount ;
7
8
use Omnipay \ECPay \Traits \HasDefaults ;
8
9
use Omnipay \ECPay \Traits \HasECPay ;
9
10
use Omnipay \ECPay \Traits \HasMerchantTradeNo ;
@@ -15,6 +16,7 @@ class RefundRequest extends AbstractRequest
15
16
use HasDefaults;
16
17
use HasMerchantTradeNo;
17
18
use HasTotalAmount;
19
+ use HasAmount;
18
20
19
21
public function setTradeNo ($ value )
20
22
{
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Omnipay \ECPay \Traits ;
4
+
5
+ trait HasAmount
6
+ {
7
+ public function getAmount ()
8
+ {
9
+ return $ this ->getParameter ('amount ' );
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -52,8 +52,6 @@ public function testGetData()
52
52
53
53
/**
54
54
* @depends testGetData
55
- *
56
- * @param $results
57
55
*/
58
56
public function testSendData ($ results )
59
57
{
Original file line number Diff line number Diff line change @@ -51,8 +51,6 @@ public function testGetData()
51
51
52
52
/**
53
53
* @depends testGetData
54
- *
55
- * @param $result
56
54
*/
57
55
public function testSendData ($ result )
58
56
{
Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ public function testGetData()
35
35
36
36
/**
37
37
* @depends testGetData
38
- *
39
- * @param $result
40
38
*/
41
39
public function testSendData ($ result )
42
40
{
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public function testGetData()
22
22
'MerchantTradeNo ' => '2821567410556 ' ,
23
23
'TradeNo ' => '1909021549160081 ' ,
24
24
'Action ' => 'R ' ,
25
- 'TotalAmount ' => '1000.00 ' ,
25
+ 'TotalAmount ' => '1000 ' ,
26
26
], $ request ->getData ());
27
27
}
28
28
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public function testGetData()
22
22
'MerchantTradeNo ' => '2821567410556 ' ,
23
23
'TradeNo ' => '1909021549160081 ' ,
24
24
'Action ' => 'N ' ,
25
- 'TotalAmount ' => '1000.00 ' ,
25
+ 'TotalAmount ' => '1000 ' ,
26
26
], $ request ->getData ());
27
27
}
28
28
}
You can’t perform that action at this time.
0 commit comments