Skip to content

Commit ef23fe7

Browse files
committed
Remove name validation from CreditCard
1 parent e4f9724 commit ef23fe7

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/Omnipay/Common/CreditCard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected function setParameter($key, $value)
120120
*/
121121
public function validate()
122122
{
123-
foreach (array('number', 'firstName', 'lastName', 'expiryMonth', 'expiryYear') as $key) {
123+
foreach (array('number', 'expiryMonth', 'expiryYear') as $key) {
124124
if (!$this->getParameter($key)) {
125125
throw new InvalidCreditCardException("The $key parameter is required");
126126
}

tests/Omnipay/Common/CreditCardTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,6 @@ public function testValidateNumberRequired()
7171
$this->card->validate();
7272
}
7373

74-
/**
75-
* @expectedException \Omnipay\Common\Exception\InvalidCreditCardException
76-
* @expectedExceptionMessage The firstName parameter is required
77-
*/
78-
public function testValidateFirstNameRequired()
79-
{
80-
$this->card->setFirstName(null);
81-
$this->card->validate();
82-
}
83-
84-
/**
85-
* @expectedException \Omnipay\Common\Exception\InvalidCreditCardException
86-
* @expectedExceptionMessage The lastName parameter is required
87-
*/
88-
public function testValidateLastNameRequired()
89-
{
90-
$this->card->setLastName(null);
91-
$this->card->validate();
92-
}
93-
9474
/**
9575
* @expectedException \Omnipay\Common\Exception\InvalidCreditCardException
9676
* @expectedExceptionMessage The expiryMonth parameter is required

0 commit comments

Comments
 (0)