@@ -121,4 +121,36 @@ public function testCapturePreAuthorizedMultiPayment()
121
121
122
122
$ this ->assertEquals ('AUTHORIZED ' , $ captured_payment ->getStatus ());
123
123
}
124
+
125
+ public function testCancelPreAuthorizedMultiPayment ()
126
+ {
127
+ $ this ->mockHttpSession ($ this ->body_multiorder );
128
+ $ order = $ this ->createMultiorder ()->create ();
129
+ $ this ->mockHttpSession ($ this ->body_cc_multipay );
130
+ $ payment = $ order ->multipayments ()
131
+ ->setCreditCard (5 , 2018 , '4012001037141112 ' , 123 , $ this ->createCustomer ())
132
+ ->setDelayCapture (true )
133
+ ->execute ();
134
+
135
+ $ this ->mockHttpSession ($ this ->body_cancel_multipay );
136
+ $ cancelled_payment = $ payment ->cancel ();
137
+
138
+ $ this ->assertEquals ('CANCELLED ' , $ cancelled_payment ->getStatus ());
139
+ }
140
+
141
+ public function testCancelPreAuthorizedPayment ()
142
+ {
143
+ $ this ->mockHttpSession ($ this ->body_order );
144
+ $ order = $ this ->createOrder ()->create ();
145
+ $ this ->mockHttpSession ($ this ->body_cc_delay_capture );
146
+ $ payment = $ order ->payments ()
147
+ ->setCreditCard (5 , 2018 , '5555666677778884 ' , 123 , $ this ->createCustomer (), false )
148
+ ->setDelayCapture (true )
149
+ ->execute ();
150
+
151
+ $ this ->mockHttpSession ($ this ->body_cancel_pay );
152
+ $ cancelled_payment = $ payment ->cancel ();
153
+
154
+ $ this ->assertEquals ('CANCELLED ' , $ cancelled_payment ->getStatus ());
155
+ }
124
156
}
0 commit comments