|
@@ 81-86 (lines=6) @@
|
| 78 |
|
|
| 79 |
|
private function validatecardVerificationValue() |
| 80 |
|
{ |
| 81 |
|
if (is_numeric($this->cardVerificationVal) |
| 82 |
|
&& $this->cardType === CreditCardValidator::AMERICAN_EXPRESS |
| 83 |
|
&& strlen($this->cardVerificationVal) === 4 |
| 84 |
|
) { |
| 85 |
|
return true; |
| 86 |
|
} |
| 87 |
|
if (is_numeric($this->cardVerificationVal) |
| 88 |
|
&& $this->cardType !== CreditCardValidator::AMERICAN_EXPRESS |
| 89 |
|
&& strlen($this->cardVerificationVal) === 3 |
|
@@ 87-92 (lines=6) @@
|
| 84 |
|
) { |
| 85 |
|
return true; |
| 86 |
|
} |
| 87 |
|
if (is_numeric($this->cardVerificationVal) |
| 88 |
|
&& $this->cardType !== CreditCardValidator::AMERICAN_EXPRESS |
| 89 |
|
&& strlen($this->cardVerificationVal) === 3 |
| 90 |
|
) { |
| 91 |
|
return true; |
| 92 |
|
} |
| 93 |
|
$message = sprintf('%s is not valid CVV.', $this->cardVerificationVal); |
| 94 |
|
throw new InvalidArgumentException($message); |
| 95 |
|
} |