@@ -36,6 +36,10 @@ public function setUp()
36
36
$ this ->storeOptions = array (
37
37
'card ' => $ this ->getValidCard (),
38
38
);
39
+
40
+ $ this ->updateOptions = array (
41
+ 'cardReference ' => 'cus_1MZSEtqSghKx99 ' ,
42
+ );
39
43
40
44
$ this ->unstoreOptions = array (
41
45
'cardReference ' => 'cus_1MZSEtqSghKx99 ' ,
@@ -113,6 +117,30 @@ public function testStoreFailure()
113
117
$ this ->assertNull ($ response ->getCardReference ());
114
118
$ this ->assertSame ('You must provide an integer value for \'exp_year \'. ' , $ response ->getMessage ());
115
119
}
120
+
121
+ public function testUpdateSuccess ()
122
+ {
123
+ $ this ->setMockHttpResponse ('UpdateSuccess.txt ' );
124
+ $ response = $ this ->gateway ->store ($ this ->storeOptions )->send ();
125
+
126
+ $ this ->assertTrue ($ response ->isSuccessful ());
127
+ $ this ->assertFalse ($ response ->isRedirect ());
128
+ $ this ->assertNull ($ response ->getTransactionReference ());
129
+ $ this ->assertSame ('cus_1MZSEtqSghKx99 ' , $ response ->getCardReference ());
130
+ $ this ->assertNull ($ response ->getMessage ());
131
+ }
132
+
133
+ public function testUpdateFailure ()
134
+ {
135
+ $ this ->setMockHttpResponse ('UpdateFailure.txt ' );
136
+ $ response = $ this ->gateway ->store ($ this ->storeOptions )->send ();
137
+
138
+ $ this ->assertFalse ($ response ->isSuccessful ());
139
+ $ this ->assertFalse ($ response ->isRedirect ());
140
+ $ this ->assertNull ($ response ->getTransactionReference ());
141
+ $ this ->assertNull ($ response ->getCardReference ());
142
+ $ this ->assertSame ('No such customer: cus_1MZeNih5LdKxDq ' , $ response ->getMessage ());
143
+ }
116
144
117
145
public function testUnstoreSuccess ()
118
146
{
0 commit comments