diff --git a/src/Common/Message/AbstractRequest.php b/src/Common/Message/AbstractRequest.php index 004a775..1fb87e7 100644 --- a/src/Common/Message/AbstractRequest.php +++ b/src/Common/Message/AbstractRequest.php @@ -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. * diff --git a/tests/Common/Message/AbstractRequestTest.php b/tests/Common/Message/AbstractRequestTest.php index 8f196e3..eee1b97 100644 --- a/tests/Common/Message/AbstractRequestTest.php +++ b/tests/Common/Message/AbstractRequestTest.php @@ -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'));