@@ -16,7 +16,7 @@ public function setUp()
16
16
{
17
17
parent ::setUp ();
18
18
19
- $ this ->response = new CompleteResponse (
19
+ $ this ->responseSuccess = new CompleteResponse (
20
20
$ this ->getMockRequest (),
21
21
[
22
22
"merchantId " => "1100016000 " ,
@@ -44,20 +44,49 @@ public function setUp()
44
44
"expm " => "12 " ,
45
45
]
46
46
);
47
+
48
+ $ this ->responseCancel = new CompleteResponse (
49
+ $ this ->getMockRequest (),
50
+ [
51
+ "maskedCC " => "424242xxxxxx4242 " ,
52
+ "merchantId " => "1100016183 " ,
53
+ "aliasCC " => "70119122433810042 " ,
54
+ "uppTermsLink " => "https://example.co.uk/ " ,
55
+ "currency " => "GBP " ,
56
+ "amount " => "2250 " ,
57
+ "uppReturnMaskedCC " => "yes " ,
58
+ "uppWebResponseMethod " => "POST " ,
59
+ "uppTransactionId " => "180820155020472779 " ,
60
+ "language " => "en " ,
61
+ "theme " => "DT2015 " ,
62
+ "refno " => "134655588975 " ,
63
+ "testOnly " => "yes " ,
64
+ "pmethod " => "VIS " ,
65
+ "sign " => "66e480fd751555d707103fe0f66b7bfef8e55a416a57ff6f33f4d2daf58469d5 " ,
66
+ "status " => "cancel " ,
67
+ "uppMsgType " => "web " ,
68
+ ]
69
+ );
47
70
}
48
71
49
72
public function testSuccess ()
50
73
{
51
- $ this ->assertSame ('4242 ' , $ this ->response ->getNumberLastFour ());
52
- $ this ->assertSame ('XXXXXXXXXXXX4242 ' , $ this ->response ->getNumberMasked ());
53
- $ this ->assertSame ('424242xxxxxx4242 ' , $ this ->response ->getNumberMasked (null ));
54
- $ this ->assertTrue ($ this ->response ->isSuccessful ());
55
- $ this ->assertFalse ($ this ->response ->isRedirect ());
56
- $ this ->assertSame (12 , $ this ->response ->getExpiryMonth ());
57
- $ this ->assertSame (18 , $ this ->response ->getExpiryYear ());
58
- $ this ->assertSame ('12/18 ' , $ this ->response ->getExpiryDate ('m/y ' ));
59
- $ this ->assertSame ('e7e86bee-0ced-43b8-9ee9-e7fbb8d4ef31 ' , $ this ->response ->getTransactionId ());
60
- $ this ->assertSame ('180317175618647060 ' , $ this ->response ->getTransactionReference ());
61
- $ this ->assertSame ('VIS ' , $ this ->response ->getUsedPaymentMethod ());
74
+ $ this ->assertSame ('4242 ' , $ this ->responseSuccess ->getNumberLastFour ());
75
+ $ this ->assertSame ('XXXXXXXXXXXX4242 ' , $ this ->responseSuccess ->getNumberMasked ());
76
+ $ this ->assertSame ('424242xxxxxx4242 ' , $ this ->responseSuccess ->getNumberMasked (null ));
77
+ $ this ->assertTrue ($ this ->responseSuccess ->isSuccessful ());
78
+ $ this ->assertFalse ($ this ->responseSuccess ->isRedirect ());
79
+ $ this ->assertSame (12 , $ this ->responseSuccess ->getExpiryMonth ());
80
+ $ this ->assertSame (18 , $ this ->responseSuccess ->getExpiryYear ());
81
+ $ this ->assertSame ('12/18 ' , $ this ->responseSuccess ->getExpiryDate ('m/y ' ));
82
+ $ this ->assertSame ('e7e86bee-0ced-43b8-9ee9-e7fbb8d4ef31 ' , $ this ->responseSuccess ->getTransactionId ());
83
+ $ this ->assertSame ('180317175618647060 ' , $ this ->responseSuccess ->getTransactionReference ());
84
+ $ this ->assertSame ('VIS ' , $ this ->responseSuccess ->getUsedPaymentMethod ());
85
+ }
86
+
87
+ public function testCancelled ()
88
+ {
89
+ $ this ->assertFalse ($ this ->responseCancel ->isSuccessful ());
90
+ $ this ->assertTrue ($ this ->responseCancel ->isCancelled ());
62
91
}
63
92
}
0 commit comments