From a1c668867f43b9d78803d57f3718f31cbc947f21 Mon Sep 17 00:00:00 2001 From: Emmanuel Awotunde Date: Mon, 19 Jun 2017 12:30:21 +0100 Subject: [PATCH 1/2] Add Verve Credit Card for validation --- src/CreditCard.php | 7 +++++++ tests/Test.php | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/CreditCard.php b/src/CreditCard.php index ce8f5d6..26b9414 100644 --- a/src/CreditCard.php +++ b/src/CreditCard.php @@ -94,6 +94,13 @@ class CreditCard 'cvcLength' => array(3), 'luhn' => true, ), + 'verve' => array( + 'type' => 'verve', + 'pattern' => '/^(506[0-1]|6500[0-2])/', + 'length' => array(16, 19), + 'cvcLength' => array(3), + 'luhn' => true, + ), ); public static function validCreditCard($number, $type = null) diff --git a/tests/Test.php b/tests/Test.php index 00f35c2..1d6fdda 100644 --- a/tests/Test.php +++ b/tests/Test.php @@ -65,6 +65,9 @@ class Test extends PHPUnit_Framework_TestCase '3530111333300000', '3566002020360505', ), + 'verve' => array( + '5060 6666 6666 6666 666', + ), ); public function testCardsTypes() From 93bc59c78c24e6244fa9031ef5aa74dc1006e368 Mon Sep 17 00:00:00 2001 From: Emmanuel Awotunde Date: Wed, 5 Jul 2017 13:10:33 +0100 Subject: [PATCH 2/2] fix verve credit card validation --- src/CreditCard.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/CreditCard.php b/src/CreditCard.php index 26b9414..580e559 100644 --- a/src/CreditCard.php +++ b/src/CreditCard.php @@ -44,6 +44,13 @@ class CreditCard 'luhn' => true, ), // Credit cards + 'verve' => array( + 'type' => 'verve', + 'pattern' => '/^(506[0-1]|6500[0-2])/', + 'length' => array(16, 19), + 'cvcLength' => array(3), + 'luhn' => true, + ), 'visa' => array( 'type' => 'visa', 'pattern' => '/^4/', @@ -93,14 +100,8 @@ class CreditCard 'length' => array(16), 'cvcLength' => array(3), 'luhn' => true, - ), - 'verve' => array( - 'type' => 'verve', - 'pattern' => '/^(506[0-1]|6500[0-2])/', - 'length' => array(16, 19), - 'cvcLength' => array(3), - 'luhn' => true, - ), + ) + ); public static function validCreditCard($number, $type = null)