Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/Common/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,27 @@ public function setCard($value)
return $this->setParameter('card', $value);
}

/**
* Set whether you wish to generate and store a card token with this request.
*
* @param bool $value
* @return $this
*/
public function setCreateToken($value)
{
return $this->setParameter('createToken', $value);
}

/**
* Get whether you wish to generate and store a card token with this request.
*
* @return bool
*/
public function getCreateToken()
{
return $this->getParameter('createToken');
}

/**
* Get the card token.
*
Expand Down
6 changes: 6 additions & 0 deletions tests/Common/Message/AbstractRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ public function testSetCardWithArray()
$this->assertSame('1234', $card->getNumber());
}

public function testCreateToken()
{
$this->assertSame($this->request, $this->request->setCreateToken(true));
$this->assertTrue($this->request->getCreateToken());
}

public function testToken()
{
$this->assertSame($this->request, $this->request->setToken('12345'));
Expand Down