Skip to content

Commit

Permalink
remove email field when creating the card
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainQuirk committed Sep 13, 2016
1 parent 3d21b68 commit e101156
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Message/CreateCardRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
9 changes: 9 additions & 0 deletions tests/Message/CreateCardRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit e101156

Please sign in to comment.