File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/Omnipay/Common/Message
tests/Omnipay/Common/Message Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,13 @@ public function validate()
222
222
*/
223
223
public function getCard ()
224
224
{
225
- return $ this ->getParameter ('card ' );
225
+ $ card = $ this ->getParameter ('card ' );
226
+
227
+ if (!$ card instanceof CreditCard) {
228
+ return new CreditCard ();
229
+ }
230
+
231
+ return $ card ;
226
232
}
227
233
228
234
/**
Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ public function testCard()
63
63
$ this ->assertSame ($ card , $ this ->request ->getCard ());
64
64
}
65
65
66
+ public function testGetCard ()
67
+ {
68
+ $ this ->assertInstanceOf ('\Omnipay\Common\CreditCard ' , $ this ->request ->getCard ());
69
+ }
70
+
66
71
public function testSetCardWithArray ()
67
72
{
68
73
// passing array should create CreditCard object
You can’t perform that action at this time.
0 commit comments