Skip to content

Commit 6f52d06

Browse files
author
Maksim Rafalko
committed
Merge remote-tracking branch 'upstream/master'
2 parents 6d0bddf + 4093503 commit 6f52d06

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Omnipay/Common/Message/AbstractRequest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,21 @@ public function getCard()
134134

135135
public function setCard($value)
136136
{
137-
if (!$value instanceof CreditCard) {
137+
if ($value && !$value instanceof CreditCard) {
138138
$value = new CreditCard($value);
139139
}
140140

141141
return $this->setParameter('card', $value);
142142
}
143143

144-
public function getCardToken()
144+
public function getToken()
145145
{
146-
return $this->getParameter('cardToken');
146+
return $this->getParameter('token');
147147
}
148148

149-
public function setCardToken($value)
149+
public function setToken($value)
150150
{
151-
return $this->setParameter('cardToken', $value);
151+
return $this->setParameter('token', $value);
152152
}
153153

154154
public function getCardReference()

tests/Omnipay/Common/Message/AbstractRequestTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public function testSetCardWithArray()
4747
$this->assertSame('1234', $card->getNumber());
4848
}
4949

50-
public function testCardToken()
50+
public function testToken()
5151
{
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());
5454
}
5555

5656
public function testCardReference()

0 commit comments

Comments
 (0)