diff --git a/src/Message/CreateCardRequest.php b/src/Message/CreateCardRequest.php index e8344fb9..a73e4765 100644 --- a/src/Message/CreateCardRequest.php +++ b/src/Message/CreateCardRequest.php @@ -103,4 +103,12 @@ public function getEndpoint() // Create a new customer and card return $this->endpoint.'/customers'; } + + public function getCardData() + { + $data = parent::getCardData(); + unset($data['email']); + + return $data; + } } diff --git a/tests/Message/CreateCardRequestTest.php b/tests/Message/CreateCardRequestTest.php index 471109ba..3d3eda41 100644 --- a/tests/Message/CreateCardRequestTest.php +++ b/tests/Message/CreateCardRequestTest.php @@ -89,4 +89,13 @@ public function testSendFailure() $this->assertNull($response->getCardReference()); $this->assertSame('You must provide an integer value for \'exp_year\'.', $response->getMessage()); } + + public function testCardWithoutEmail() + { + $card = $this->getValidCard(); + $this->request->setCard($card); + $data = $this->request->getData(); + + $this->assertArrayNotHasKey('email', $card); + } }