File tree Expand file tree Collapse file tree 6 files changed +20
-2
lines changed
Expand file tree Collapse file tree 6 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ composer.lock
33vendor
44build
55.php_cs.cache
6+ .phpunit.result.cache
67
Original file line number Diff line number Diff line change 33namespace Omnipay \MyPay \Message ;
44
55use Omnipay \Common \Message \AbstractRequest as BaseAbstractRequest ;
6+ use Omnipay \MyPay \Traits \HasAmount ;
67use Omnipay \MyPay \Traits \HasEcho ;
78use Omnipay \MyPay \Traits \HasKey ;
89use Omnipay \MyPay \Traits \HasOrderInfo ;
@@ -18,6 +19,7 @@ class CompletePurchaseRequest extends BaseAbstractRequest
1819 use HasOrderInfo;
1920 use HasOrderResult;
2021 use HasEcho;
22+ use HasAmount;
2123
2224 /**
2325 * 交易回傳碼(參閱附錄二).
Original file line number Diff line number Diff line change 66use Omnipay \MyPay \Encryption ;
77use Omnipay \MyPay \Item ;
88use Omnipay \MyPay \Traits \HasAgent ;
9+ use Omnipay \MyPay \Traits \HasAmount ;
910use Omnipay \MyPay \Traits \HasCardLess ;
1011use Omnipay \MyPay \Traits \HasEcho ;
1112use Omnipay \MyPay \Traits \HasEWallet ;
@@ -31,6 +32,7 @@ class PurchaseRequest extends AbstractRequest
3132 use HasInvoice;
3233 use HasLocale;
3334 use HasAgent;
35+ use HasAmount;
3436
3537 public function setVouchers ($ value )
3638 {
@@ -282,7 +284,7 @@ public function getData()
282284 'user_cellphone ' => $ this ->getUserCellphone (),
283285 'user_email ' => $ this ->getUserEmail (),
284286 'user_birthday ' => $ this ->getUserBirthday (),
285- 'cost ' => ( int ) $ this ->getAmount (),
287+ 'cost ' => $ this ->getAmount (),
286288 'currency ' => $ this ->getCurrency (),
287289 'order_id ' => $ this ->getTransactionId (),
288290 'regular ' => $ this ->getRegular (),
Original file line number Diff line number Diff line change 33namespace Omnipay \MyPay \Message ;
44
55use Omnipay \MyPay \Encryption ;
6+ use Omnipay \MyPay \Traits \HasAmount ;
67use Omnipay \MyPay \Traits \HasCost ;
78use Omnipay \MyPay \Traits \HasKey ;
89use Omnipay \MyPay \Traits \HasStore ;
@@ -14,6 +15,7 @@ class RefundRequest extends AbstractRequest
1415 use HasUid;
1516 use HasKey;
1617 use HasCost;
18+ use HasAmount;
1719
1820 /**
1921 * 4.作廢或作廢重開(預設)
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Omnipay \MyPay \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 @@ -66,7 +66,7 @@ public function testGetData()
6666 'uid ' => '86579 ' ,
6767 'order_id ' => 'd5jUed1tkQ9cDaD1 ' ,
6868 'user_id ' => 'DoSuccess3D ' ,
69- 'cost ' => '1000.00 ' ,
69+ 'cost ' => '1000 ' ,
7070 'currency ' => 'TWD ' ,
7171 'actual_cost ' => '1000 ' ,
7272 'actual_currency ' => 'TWD ' ,
You can’t perform that action at this time.
0 commit comments