Skip to content

Commit

Permalink
Merge pull request #56 from MarieCloud/remove-email-in-card-create
Browse files Browse the repository at this point in the history
remove email field when creating the card
  • Loading branch information
delatbabel authored Sep 14, 2016
2 parents 3d21b68 + e101156 commit f2c5b48
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 f2c5b48

Please sign in to comment.