1515use TransactPro \Gateway \DataSets \DataSet ;
1616use TransactPro \Gateway \DataSets \Info ;
1717use TransactPro \Gateway \Http \Response ;
18+ use TransactPro \Gateway \Responses \Constants \CardFamily ;
1819use TransactPro \Gateway \Responses \Constants \Status as StatusCode ;
1920use TransactPro \Gateway \Validator \Validator ;
2021
@@ -42,9 +43,10 @@ public function testSuccess(): void
4243 public function testParseStatusResponse (): void
4344 {
4445 $ body = "{ \"transactions \":[{ \"gateway-transaction-id \": \"cd7b8bdf-3c78-4540-95d0-68018d2aba97 \", \"status \": " .
45- "[{ \"gateway-transaction-id \": \"cd7b8bdf-3c78-4540-95d0-68018d2aba97 \", \"status-code \":7, \"status-code-general \":8, " .
46- "\"status-text \": \"SUCCESS \", \"status-text-general \": \"EXPIRED \"}]},{ \"gateway-transaction-id \": \"37908991-789b-4d79-8c6a-f90ba0ce12b6 \", " .
47- "\"status \":[{ \"gateway-transaction-id \": \"37908991-789b-4d79-8c6a-f90ba0ce12b6 \", \"status-code \":8, \"status-code-general \":7, " .
46+ "[{ \"card-mask \": \"534219*5267 \", \"card-family \": \"MC \", \"gateway-transaction-id \": \"cd7b8bdf-3c78-4540-95d0-68018d2aba97 \", " .
47+ "\"status-code \":7, \"status-code-general \":8, \"status-text \": \"SUCCESS \", \"status-text-general \": \"EXPIRED \"}]}, " .
48+ "{ \"gateway-transaction-id \": \"37908991-789b-4d79-8c6a-f90ba0ce12b6 \", \"status \":[ " .
49+ "{ \"gateway-transaction-id \": \"37908991-789b-4d79-8c6a-f90ba0ce12b6 \", \"status-code \":8, \"status-code-general \":7, " .
4850 "\"status-text \": \"EXPIRED \", \"status-text-general \": \"SUCCESS \"}]}, " .
4951 "{ \"error \":{ \"code \":400, \"message \": \"Failed to fetch data for transaction with gateway id: 99900000-789b-4d79-8c6a-f90ba0ce12b0 \"}, " .
5052 "\"gateway-transaction-id \": \"99900000-789b-4d79-8c6a-f90ba0ce12b0 \"}]} " ;
@@ -59,6 +61,8 @@ public function testParseStatusResponse(): void
5961 $ this ->assertEquals (StatusCode::EXPIRED , $ tr1 ->statusCodeGeneral );
6062 $ this ->assertEquals ("SUCCESS " , $ tr1 ->statusText );
6163 $ this ->assertEquals ("EXPIRED " , $ tr1 ->statusTextGeneral );
64+ $ this ->assertEquals (CardFamily::MASTER_CARD , $ tr1 ->cardFamily );
65+ $ this ->assertEquals ("534219*5267 " , $ tr1 ->cardMask );
6266
6367 $ tr2 = $ parsedResponse ->transactions [1 ];
6468 $ this ->assertEquals ("37908991-789b-4d79-8c6a-f90ba0ce12b6 " , $ tr2 ->gatewayTransactionId );
0 commit comments