File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 2
2
/**
3
3
* MultiSafepay Rest Api Purchase Response.
4
4
*/
5
+
5
6
namespace Omnipay \MultiSafepay \Message ;
6
7
7
8
use Omnipay \Common \Message \RedirectResponseInterface ;
88
89
*/
89
90
class RestPurchaseResponse extends RestAbstractResponse implements RedirectResponseInterface
90
91
{
92
+ /**
93
+ * Is the response successful?
94
+ *
95
+ * @return bool
96
+ */
97
+ public function isSuccessful ()
98
+ {
99
+ if ($ this ->isRedirect ()) {
100
+ return false ;
101
+ }
102
+
103
+ return parent ::isSuccessful ();
104
+ }
105
+
91
106
/**
92
107
* {@inheritdoc}
93
108
*/
@@ -101,8 +116,8 @@ public function isRedirect()
101
116
*/
102
117
public function getRedirectUrl ()
103
118
{
104
- if (! $ this ->isRedirect ()) {
105
- return null ;
119
+ if (!$ this ->isRedirect ()) {
120
+ return ;
106
121
}
107
122
108
123
return $ this ->data ['data ' ]['payment_url ' ];
@@ -121,6 +136,6 @@ public function getRedirectMethod()
121
136
*/
122
137
public function getRedirectData ()
123
138
{
124
- return null ;
139
+ return ;
125
140
}
126
141
}
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public function testSendSuccess()
46
46
47
47
$ response = $ this ->request ->send ();
48
48
49
- $ this ->assertTrue ($ response ->isSuccessful ());
49
+ $ this ->assertFalse ($ response ->isSuccessful ());
50
50
$ this ->assertTrue ($ response ->isRedirect ());
51
51
52
52
$ this ->assertEquals (
You can’t perform that action at this time.
0 commit comments