77class AIMResponseTest extends TestCase
88{
99 /**
10- * @expectedException Omnipay\Common\Exception\InvalidResponseException
10+ * @expectedException \ Omnipay\Common\Exception\InvalidResponseException
1111 */
1212 public function testConstructEmpty ()
1313 {
@@ -23,9 +23,11 @@ public function testAuthorizeSuccess()
2323 $ this ->assertSame ('2184493132 ' , $ response ->getTransactionReference ());
2424 $ this ->assertSame ('This transaction has been approved. ' , $ response ->getMessage ());
2525 $ this ->assertSame ('1 ' , $ response ->getCode ());
26+ $ this ->assertSame ('Approved ' , $ response ->getCodeMessage ());
2627 $ this ->assertSame ('1 ' , $ response ->getReasonCode ());
2728 $ this ->assertSame ('GA4OQP ' , $ response ->getAuthorizationCode ());
2829 $ this ->assertSame ('Y ' , $ response ->getAVSCode ());
30+ $ this ->assertSame ('Address (Street) and five digit ZIP match ' , $ response ->getAVSCodeMessage ());
2931 }
3032
3133 public function testAuthorizeFailure ()
@@ -37,9 +39,11 @@ public function testAuthorizeFailure()
3739 $ this ->assertSame ('0 ' , $ response ->getTransactionReference ());
3840 $ this ->assertSame ('A valid amount is required. ' , $ response ->getMessage ());
3941 $ this ->assertSame ('3 ' , $ response ->getCode ());
42+ $ this ->assertSame ('Error ' , $ response ->getCodeMessage ());
4043 $ this ->assertSame ('5 ' , $ response ->getReasonCode ());
4144 $ this ->assertSame ('' , $ response ->getAuthorizationCode ());
4245 $ this ->assertSame ('P ' , $ response ->getAVSCode ());
46+ $ this ->assertSame ('AVS not applicable for this transaction ' , $ response ->getAVSCodeMessage ());
4347 }
4448
4549 public function testCaptureSuccess ()
@@ -51,9 +55,11 @@ public function testCaptureSuccess()
5155 $ this ->assertSame ('2184494531 ' , $ response ->getTransactionReference ());
5256 $ this ->assertSame ('This transaction has been approved. ' , $ response ->getMessage ());
5357 $ this ->assertSame ('1 ' , $ response ->getCode ());
58+ $ this ->assertSame ('Approved ' , $ response ->getCodeMessage ());
5459 $ this ->assertSame ('1 ' , $ response ->getReasonCode ());
5560 $ this ->assertSame ('F51OYG ' , $ response ->getAuthorizationCode ());
5661 $ this ->assertSame ('P ' , $ response ->getAVSCode ());
62+ $ this ->assertSame ('AVS not applicable for this transaction ' , $ response ->getAVSCodeMessage ());
5763 }
5864
5965 public function testCaptureFailure ()
@@ -65,9 +71,11 @@ public function testCaptureFailure()
6571 $ this ->assertSame ('0 ' , $ response ->getTransactionReference ());
6672 $ this ->assertSame ('The transaction cannot be found. ' , $ response ->getMessage ());
6773 $ this ->assertSame ('3 ' , $ response ->getCode ());
74+ $ this ->assertSame ('Error ' , $ response ->getCodeMessage ());
6875 $ this ->assertSame ('16 ' , $ response ->getReasonCode ());
6976 $ this ->assertSame ('' , $ response ->getAuthorizationCode ());
7077 $ this ->assertSame ('P ' , $ response ->getAVSCode ());
78+ $ this ->assertSame ('AVS not applicable for this transaction ' , $ response ->getAVSCodeMessage ());
7179 }
7280
7381 public function testPurchaseSuccess ()
@@ -79,9 +87,11 @@ public function testPurchaseSuccess()
7987 $ this ->assertSame ('2184492509 ' , $ response ->getTransactionReference ());
8088 $ this ->assertSame ('This transaction has been approved. ' , $ response ->getMessage ());
8189 $ this ->assertSame ('1 ' , $ response ->getCode ());
90+ $ this ->assertSame ('Approved ' , $ response ->getCodeMessage ());
8291 $ this ->assertSame ('1 ' , $ response ->getReasonCode ());
8392 $ this ->assertSame ('JE6JM1 ' , $ response ->getAuthorizationCode ());
8493 $ this ->assertSame ('Y ' , $ response ->getAVSCode ());
94+ $ this ->assertSame ('Address (Street) and five digit ZIP match ' , $ response ->getAVSCodeMessage ());
8595 }
8696
8797 public function testPurchaseFailure ()
@@ -93,9 +103,11 @@ public function testPurchaseFailure()
93103 $ this ->assertSame ('0 ' , $ response ->getTransactionReference ());
94104 $ this ->assertSame ('A valid amount is required. ' , $ response ->getMessage ());
95105 $ this ->assertSame ('3 ' , $ response ->getCode ());
106+ $ this ->assertSame ('Error ' , $ response ->getCodeMessage ());
96107 $ this ->assertSame ('5 ' , $ response ->getReasonCode ());
97108 $ this ->assertSame ('' , $ response ->getAuthorizationCode ());
98109 $ this ->assertSame ('P ' , $ response ->getAVSCode ());
110+ $ this ->assertSame ('AVS not applicable for this transaction ' , $ response ->getAVSCodeMessage ());
99111 }
100112
101113 public function testRefundSuccess ()
@@ -108,8 +120,10 @@ public function testRefundSuccess()
108120 $ this ->assertSame ('2184492509 ' , $ response ->getTransactionReference ());
109121 $ this ->assertSame ('This transaction has been approved. ' , $ response ->getMessage ());
110122 $ this ->assertSame ('1 ' , $ response ->getCode ());
123+ $ this ->assertSame ('Approved ' , $ response ->getCodeMessage ());
111124 $ this ->assertSame ('1 ' , $ response ->getReasonCode ());
112125 $ this ->assertSame ('P ' , $ response ->getAVSCode ());
126+ $ this ->assertSame ('AVS not applicable for this transaction ' , $ response ->getAVSCodeMessage ());
113127 }
114128
115129 public function testRefundFailure ()
@@ -121,8 +135,10 @@ public function testRefundFailure()
121135 $ this ->assertSame ('0 ' , $ response ->getTransactionReference ());
122136 $ this ->assertSame ('The credit card number is invalid. ' , $ response ->getMessage ());
123137 $ this ->assertSame ('3 ' , $ response ->getCode ());
138+ $ this ->assertSame ('Error ' , $ response ->getCodeMessage ());
124139 $ this ->assertSame ('6 ' , $ response ->getReasonCode ());
125140 $ this ->assertSame ('' , $ response ->getAuthorizationCode ());
126141 $ this ->assertSame ('P ' , $ response ->getAVSCode ());
142+ $ this ->assertSame ('AVS not applicable for this transaction ' , $ response ->getAVSCodeMessage ());
127143 }
128144}
0 commit comments