@@ -96,6 +96,81 @@ public function testCompletePurchaseFailure()
96
96
97
97
$ response = $ this ->gateway ->completePurchase ($ this ->options )->send ();
98
98
99
+ $ this ->assertFalse ($ response ->isSuccessful ());
100
+ $ this ->assertFalse ($ response ->isRedirect ());
101
+ $ this ->assertNull ($ response ->getTransactionReference ());
102
+
103
+ var_dump ($ response ->getMessage ());
104
+
105
+ $ this ->assertSame ('Unable to find transaction ' , $ response ->getMessage ());
106
+ }
107
+
108
+ public function testCaptureSuccess ()
109
+ {
110
+ $ this ->setMockHttpResponse ('CaptureSuccess.txt ' );
111
+
112
+ $ response = $ this ->gateway ->capture ($ this ->options )->send ();
113
+
114
+ $ this ->assertTrue ($ response ->isSuccessful ());
115
+ $ this ->assertFalse ($ response ->isRedirect ());
116
+ $ this ->assertEquals ('cc497f37603678c61a09fd5645959812 ' , $ response ->getTransactionReference ());
117
+ $ this ->assertSame ('OK ' , $ response ->getMessage ());
118
+ }
119
+
120
+ public function testCaptureFailure ()
121
+ {
122
+ $ this ->setMockHttpResponse ('CaptureFailure.txt ' );
123
+
124
+ $ response = $ this ->gateway ->capture ($ this ->options )->send ();
125
+
126
+ $ this ->assertFalse ($ response ->isSuccessful ());
127
+ $ this ->assertFalse ($ response ->isRedirect ());
128
+ $ this ->assertNull ($ response ->getTransactionReference ());
129
+ $ this ->assertSame ('Unable to find transaction ' , $ response ->getMessage ());
130
+ }
131
+
132
+ public function testAnnulSuccess ()
133
+ {
134
+ $ this ->setMockHttpResponse ('AnnulSuccess.txt ' );
135
+
136
+ $ response = $ this ->gateway ->capture ($ this ->options )->send ();
137
+
138
+ $ this ->assertTrue ($ response ->isSuccessful ());
139
+ $ this ->assertFalse ($ response ->isRedirect ());
140
+ $ this ->assertEquals ('3fece3574598c6ae3932fae5f38bc8af ' , $ response ->getTransactionReference ());
141
+ $ this ->assertSame ('OK ' , $ response ->getMessage ());
142
+ }
143
+
144
+ public function testAnnulFailure ()
145
+ {
146
+ $ this ->setMockHttpResponse ('AnnulFailure.txt ' );
147
+
148
+ $ response = $ this ->gateway ->capture ($ this ->options )->send ();
149
+
150
+ $ this ->assertFalse ($ response ->isSuccessful ());
151
+ $ this ->assertFalse ($ response ->isRedirect ());
152
+ $ this ->assertNull ($ response ->getTransactionReference ());
153
+ $ this ->assertSame ('Unable to find transaction ' , $ response ->getMessage ());
154
+ }
155
+
156
+ public function testCreditSuccess ()
157
+ {
158
+ $ this ->setMockHttpResponse ('CreditSuccess.txt ' );
159
+
160
+ $ response = $ this ->gateway ->capture ($ this ->options )->send ();
161
+
162
+ $ this ->assertTrue ($ response ->isSuccessful ());
163
+ $ this ->assertFalse ($ response ->isRedirect ());
164
+ $ this ->assertEquals ('3fece3574598c6ae3932fae5f38bc8af ' , $ response ->getTransactionReference ());
165
+ $ this ->assertSame ('OK ' , $ response ->getMessage ());
166
+ }
167
+
168
+ public function testCreditFailure ()
169
+ {
170
+ $ this ->setMockHttpResponse ('CreditFailure.txt ' );
171
+
172
+ $ response = $ this ->gateway ->capture ($ this ->options )->send ();
173
+
99
174
$ this ->assertFalse ($ response ->isSuccessful ());
100
175
$ this ->assertFalse ($ response ->isRedirect ());
101
176
$ this ->assertNull ($ response ->getTransactionReference ());
0 commit comments