@@ -53,13 +53,31 @@ public function testCompletePurchaseSuccess()
5353
5454 $ response = $ this ->gateway ->completePurchase ($ options )->send ();
5555
56+ $ this ->assertFalse ($ response ->isPending ());
5657 $ this ->assertTrue ($ response ->isSuccessful ());
5758 $ this ->assertFalse ($ response ->isRedirect ());
5859 $ this ->assertSame ('1234567890_0 ' , $ response ->getTransactionReference ());
5960 $ this ->assertSame ('PENDING_CAPTURE ' , $ response ->getMessage ());
6061 $ this ->assertSame ('12345678-90ab-cdef-1234-567890abcdef ' , $ response ->getCardReference ());
6162 }
6263
64+ public function testCompletePurchasePending ()
65+ {
66+ // @todo - make mock response
67+ $ this ->setMockHttpResponse ('HostedCompletePurchasePending.txt ' );
68+
69+ $ options = array_merge ($ this ->options , ['hostedCheckoutId ' => '0000000001 ' ]);
70+
71+ $ response = $ this ->gateway ->completePurchase ($ options )->send ();
72+
73+ $ this ->assertTrue ($ response ->isPending ());
74+ $ this ->assertFalse ($ response ->isSuccessful ());
75+ $ this ->assertFalse ($ response ->isRedirect ());
76+ $ this ->assertSame ('1234567890_0 ' , $ response ->getTransactionReference ());
77+ $ this ->assertSame ('REDIRECTED ' , $ response ->getMessage ());
78+ $ this ->assertSame ('12345678-90ab-cdef-1234-567890abcdef ' , $ response ->getCardReference ());
79+ }
80+
6381 public function testCompletePurchaseFailure ()
6482 {
6583 $ this ->setMockHttpResponse ('HostedCompletePurchaseFailure.txt ' );
@@ -68,6 +86,7 @@ public function testCompletePurchaseFailure()
6886
6987 $ response = $ this ->gateway ->completePurchase ($ options )->send ();
7088
89+ $ this ->assertFalse ($ response ->isPending ());
7190 $ this ->assertFalse ($ response ->isSuccessful ());
7291 $ this ->assertFalse ($ response ->isRedirect ());
7392 $ this ->assertSame ('1234567890_0 ' , $ response ->getTransactionReference ());
0 commit comments