Skip to content

Commit

Permalink
atm
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed Sep 5, 2024
1 parent b672e8c commit e9ebb39
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Message/XWallet/AcceptNotificationRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,27 @@ public function testGetData(): void
self::assertEquals('test202309011123001', $request->getTransactionId());
self::assertEquals(NotificationInterface::STATUS_COMPLETED, $request->getTransactionStatus());
}

public function testGetDataForAtm()
{
$encryptor = new Encryptor($this->initialize['HashKey'], $this->initialize['HashIV']);
$data = [
'FirmOrderNo' => 'test202309011123001',
'PayBankCode' => '001',
'PayBankAccount' => '2592600213085401',
'PriceReal' => 100,
];
$httpRequest = new HttpRequest([], [], [], [], [], [], json_encode([
'state' => '1',
'code' => '201',
'msg' => '繳費代碼或帳號取得成功',
'data' => $encryptor->encrypt($data),
]));
$httpRequest->setMethod('POST');
$request = new AcceptNotificationRequest($this->getHttpClient(), $httpRequest);
$request->initialize(array_merge($this->initialize, []));

self::assertEquals('繳費代碼或帳號取得成功', $request->getMessage());
self::assertEquals('test202309011123001', $request->getTransactionId());
}
}

0 comments on commit e9ebb39

Please sign in to comment.