Skip to content

Commit 70dd142

Browse files
committed
default PaymentType aio
1 parent 58975af commit 70dd142

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/Message/PurchaseRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getData()
8282
'MerchantID' => $this->getMerchantID(),
8383
'MerchantTradeNo' => $this->getTransactionId(),
8484
'MerchantTradeDate' => $this->getMerchantTradeDate(),
85-
'PaymentType' => $this->getPaymentType(),
85+
'PaymentType' => $this->getPaymentType() ?: 'aio',
8686
'TotalAmount' => (int) $amount,
8787
'TradeDesc' => UrlService::ecpayUrlEncode($this->getDescription()),
8888
'ChoosePayment' => $this->getChoosePayment() ?: 'ALL',

tests/Message/PurchaseRequestTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ public function testGetData()
4444
$request->setTestMode(true);
4545
$request->setReturnUrl($returnUrl);
4646
$request->setNotifyUrl($notifyUrl);
47-
$request->setItems([[
48-
'Name' => '歐付寶黑芝麻豆漿',
49-
'Price' => 2000,
50-
'Quantity' => 1,
51-
'Currency' => 'TWD',
52-
]]);
47+
$request->setItems([
48+
[
49+
'Name' => '歐付寶黑芝麻豆漿',
50+
'Price' => 2000,
51+
'Quantity' => 1,
52+
'Currency' => 'TWD',
53+
],
54+
]);
5355
$options['ItemName'] = '歐付寶黑芝麻豆漿 2000 TWD x 1';
5456
$options['TradeDesc'] = UrlService::ecpayUrlEncode($options['TradeDesc']);
5557

0 commit comments

Comments
 (0)