File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
src/Omnipay/Common/Message
tests/Omnipay/Common/Message Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -134,21 +134,21 @@ public function getCard()
134
134
135
135
public function setCard ($ value )
136
136
{
137
- if (!$ value instanceof CreditCard) {
137
+ if ($ value && !$ value instanceof CreditCard) {
138
138
$ value = new CreditCard ($ value );
139
139
}
140
140
141
141
return $ this ->setParameter ('card ' , $ value );
142
142
}
143
143
144
- public function getCardToken ()
144
+ public function getToken ()
145
145
{
146
- return $ this ->getParameter ('cardToken ' );
146
+ return $ this ->getParameter ('token ' );
147
147
}
148
148
149
- public function setCardToken ($ value )
149
+ public function setToken ($ value )
150
150
{
151
- return $ this ->setParameter ('cardToken ' , $ value );
151
+ return $ this ->setParameter ('token ' , $ value );
152
152
}
153
153
154
154
public function getCardReference ()
Original file line number Diff line number Diff line change @@ -47,10 +47,10 @@ public function testSetCardWithArray()
47
47
$ this ->assertSame ('1234 ' , $ card ->getNumber ());
48
48
}
49
49
50
- public function testCardToken ()
50
+ public function testToken ()
51
51
{
52
- $ this ->assertSame ($ this ->request , $ this ->request ->setCardToken ('12345 ' ));
53
- $ this ->assertSame ('12345 ' , $ this ->request ->getCardToken ());
52
+ $ this ->assertSame ($ this ->request , $ this ->request ->setToken ('12345 ' ));
53
+ $ this ->assertSame ('12345 ' , $ this ->request ->getToken ());
54
54
}
55
55
56
56
public function testCardReference ()
You can’t perform that action at this time.
0 commit comments