diff --git a/modules/payment/includes/commerce_payment.credit_card.inc b/modules/payment/includes/commerce_payment.credit_card.inc index 0d34fdfa..cda23e46 100644 --- a/modules/payment/includes/commerce_payment.credit_card.inc +++ b/modules/payment/includes/commerce_payment.credit_card.inc @@ -394,8 +394,6 @@ function commerce_payment_credit_card_types() { /** * Provides logic for listing card types and validating card details. - * - * Backport of the CreditCard class from Commerce 2. */ final class CommercePaymentCreditCard { @@ -433,8 +431,8 @@ final class CommercePaymentCreditCard { 'number_lengths' => array(15), 'security_code_length' => 4, ), - 'dinersclub' => array( - 'id' => 'dinersclub', + 'dc' => array( + 'id' => 'dc', 'label' => t('Diners Club'), 'number_prefixes' => array('300-305', '309', '36', '38', '39'), 'number_lengths' => array(14), diff --git a/modules/payment/tests/commerce_payment_credit_card.test b/modules/payment/tests/commerce_payment_credit_card.test index 2b7c3622..72573f15 100644 --- a/modules/payment/tests/commerce_payment_credit_card.test +++ b/modules/payment/tests/commerce_payment_credit_card.test @@ -7,8 +7,6 @@ /** * Tests credit card detection. - * - * This test is a backport of the CreditCardTest from Commerce 2. */ class CommercePaymentCreditCardTest extends DrupalUnitTestCase { @@ -48,10 +46,14 @@ class CommercePaymentCreditCardTest extends DrupalUnitTestCase { array(6759649826438453, 'maestro', TRUE), array(3528000700000000, 'jcb', TRUE), array(5555555555554444, 'mastercard', TRUE), - array(36700102000000, 'dinersclub', TRUE), + array(36700102000000, 'dc', TRUE), + array(30569309025904, 'dc', TRUE), + array(38520000023237, 'dc', TRUE), array(6011000400000000, 'discover', TRUE), array(6208205838887174, 'unionpay', TRUE), array(374251018720018, 'amex', TRUE), + // Visa Electron card. + array(4917300800000000, 'visa', TRUE), ); foreach ($data as $datum) {