[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#828630: jessie-pu: package libbusiness-creditcard-perl/0.33-1+deb8u1



On Sun, 26 Jun 2016 17:00:36 +0100, Adam D. Barratt wrote:

> On Sun, 2016-06-26 at 15:10 +0200, gregor herrmann wrote:
> > I've prepared an update for libbusiness-creditcard-perl in
> > jessie{,-updates} which fixes #814479 for stable users. The issue at
> > hand is that the credit card ranges of several providers need to be
> > updated.
> That bug report says "[t]he most important change in this release is
> recognition of new MasterCard ranges which will be issued starting in
> October 2016". Given that (I'd really hope that) the next point release
> will be well before October, are any of the other changes sufficiently
> urgent to need a -updates release?

I'm also only aware of the October deadline.
Maybe Ivan knows more?
(Cc'd. Too bad X-Debbugs-CC does't get carried over from original bug
report.)
 
> > In practice there are several options to do this update in stable:
> > - What I've prepared (attached as a debdiff) for now is to backport
> >   the functional and some documentation changes from 0.34 and 0.35 to
> >   0.33 in 3 logically separate quilt patches, in order to make
> >   reviewing easy. In practice this leaves out only some minor changes
> >   in metadata and unrelated documentation changes from 0.35.
> > - Ivan (upstream and Debian contributor) originally asked to take
> >   the 0.35 release and upload it to stable (presumably as
> >   0.35-0+deb8u1). This had the advantage of shipping a fully tested
> >   release but is probably not the release team's typically preferred
> >   way. -- Complete diff:
> >   https://metacpan.org/diff/file?target=IVAN%2FBusiness-CreditCard-0.35%2F&source=IVAN%2FBusiness-CreditCard-0.33%2F
> 
> I'd be okay with either of those options, having looked at the upstream
> diff.

Thanks, then I think we can proceed with the second option, i.e.
updating to the "full" 0.35 release.

I'm attaching a new debdiff for the proposed upload.


Cheers,
gregor

-- 
 .''`.  Homepage https://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer -  https://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   
diff -Nru libbusiness-creditcard-perl-0.33/Changes libbusiness-creditcard-perl-0.35/Changes
--- libbusiness-creditcard-perl-0.33/Changes	2014-09-14 01:13:26.000000000 +0200
+++ libbusiness-creditcard-perl-0.35/Changes	2016-02-09 23:43:57.000000000 +0100
@@ -1,5 +1,21 @@
 Revision history for Perl extension Business::CreditCard.
 
+0.35  Tue Feb  9 14:43:38 PST 2016
+        - Fix bug identifying 49* Visa cards introduced in 0.34, patch from
+          Ed J, thanks!
+        - doc: Clarify processing agreements don't apply to Canada
+
+0.34  Fri Feb  5 07:24:00 PST 2016
+        - 19 digit Visa and Discover cards
+        - MasterCard 222100–272099 range
+        - Canada does not process JCB 3529-3589 as Discover, but Puerto Rico,
+          US Virgin Islans, Northern Mariana Islands, Palau and Guam do
+        - China Union Pay only processed as Discover in the US, Mexico and
+          the Caribbean, not elsewhere outside China
+        - 14 digit Discover remain only in 36*
+        - receipt_cardtype subroutine supporting Discover's new receipt
+          requirements
+
 0.33  Sat Sep 13 16:13:15 PDT 2014
         - With $Country explicity to CA, fix identification of JCB 3529-3589
           as Discover
diff -Nru libbusiness-creditcard-perl-0.33/CreditCard.pm libbusiness-creditcard-perl-0.35/CreditCard.pm
--- libbusiness-creditcard-perl-0.33/CreditCard.pm	2014-09-14 01:12:48.000000000 +0200
+++ libbusiness-creditcard-perl-0.35/CreditCard.pm	2016-02-09 23:43:32.000000000 +0100
@@ -5,7 +5,7 @@
 
 @ISA = qw( Exporter );
 
-$VERSION = "0.33";
+$VERSION = "0.35";
 
 $Country = 'US';
 
@@ -83,7 +83,7 @@
 other networks, in which one type of card is processed as another card type.
 
 By default, Business::CreditCard returns the type the card should be treated as
-in the US and Canada.  You can change this to return the type the card should
+in the US.  You can change this to return the type the card should
 be treated as in a different country by setting
 C<$Business::CreditCard::Country> to your two-letter country code.  This
 is probably what you want to determine if you accept the card, or which
@@ -99,28 +99,30 @@
 
 =item Most Diner's club is now identified as Discover.  (This supercedes the earlier identification of some Diner's club cards as MasterCard inside the US and Canada.)
 
-=item JCB cards in the 3528-3589 range are identified as Discover inside the US and Canada.
+=item JCB cards in the 3528-3589 range are identified as Discover inside the US and territories.
 
-=item China Union Pay cards are identified as Discover cards outside China.
+=item China Union Pay cards are identified as Discover cards in the US, Mexico and most Caribbean countries.
 
 =back
 
-=head1 NOTE ON INTENDED PURPOSE
+=head1 RECEIPT REQUIREMENTS
 
-This module is for verifying I<real world> B<credit cards>.  It is B<NOT> a
-pedantic implementation of the ISO 7812 standard, a general-purpose LUHN
-implementation, or intended for use with "creditcard-like account numbers".
+Discover requires some cards processed on its network to display "PayPal"
+on receipts instead of "Discover".  The receipt_cardtype() subroutine will
+return "PayPal card" for these cards only, and otherwise the same output as
+cardtype().
 
-=head1 AUTHOR
+Use this for receipt display/printing only.
+
+=head1 ORIGINAL AUTHOR
 
 Jon Orwant
 
 The Perl Journal and MIT Media Lab
 
-orwant@tpj.com
+=head1 MAINTAINER
 
 Current maintainer is Ivan Kohler <ivan-business-creditcard@420.am>.
-Please don't bother Jon with emails about this module.
 
 Lee Lawrence <LeeL@aspin.co.uk>, Neale Banks <neale@lowendale.com.au> and
 Max Becker <Max.Becker@firstgate.com> contributed support for additional card
@@ -132,7 +134,7 @@
 
 Copyright (C) 1995,1996,1997 Jon Orwant
 Copyright (C) 2001-2006 Ivan Kohler
-Copyright (C) 2007-2014 Freeside Internet Services, Inc.
+Copyright (C) 2007-2016 Freeside Internet Services, Inc.
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.8.8 or,
@@ -194,30 +196,32 @@
             && 0+$number;
     }
 
-    return "VISA card" if $number =~ /^4[0-8][\dx]{11}([\dx]{3})?$/o;
+    return "VISA card" if $number =~ /^4[0-8][\dx]{11,17}$/o;
 
     return "MasterCard"
-      if   $number =~ /^5[1-5][\dx]{14}$/o
-      ;# || ( $number =~ /^36[\dx]{12}/ && $Country =~ /^(US|CA)$/oi );
+      if $number =~ /^5[1-5][\dx]{14}$/o
+      || $number =~ /^2 ( 22[1-9] | 2[3-9][\dx] | [3-6][\dx]{2} | 7[0-1][\dx] | 720 ) [\dx]{12}$/xo
+      || $number =~ /^2[2-7]xx[\dx]{12}$/o;
 
     return "American Express card" if $number =~ /^3[47][\dx]{13}$/o;
 
     return "Discover card"
-      if   $number =~ /^30[0-5][\dx]{11}([\dx]{2})?$/o  #diner's: 300-305
-      ||   $number =~ /^3095[\dx]{10}([\dx]{2})?$/o     #diner's: 3095
-      ||   $number =~ /^3[689][\dx]{12}([\dx]{2})?$/o   #diner's: 36 38 and 39
-      ||   $number =~ /^6011[\dx]{12}$/o
-      ||   $number =~ /^64[4-9][\dx]{13}$/o
-      ||   $number =~ /^65[\dx]{14}$/o
-      || ( $number =~ /^62[24-68][\dx]{13}$/o && uc($Country) ne 'CN' ) #CUP
-      || ( $number =~ /^35(2[89]|[3-8][\dx])[\dx]{12}$/o && $Country =~ /^(US|CA)$/oi ); #JCB cards in the 3528-3589 range are identified as Discover inside the US and Canada
+      if   $number =~ /^30[0-5][\dx]{13,16}$/o #diner's: 300-305
+      ||   $number =~ /^3095[\dx]{12}$/o       #diner's: 3095
+      ||   $number =~ /^36[\dx]{12,17}$/o      #diner's: 36
+      ||   $number =~ /^3[89][\dx]{14,17}$/o   #diner's: 38 and 39
+      ||   $number =~ /^6011[\dx]{12,15}$/o
+      ||   $number =~ /^64[4-9][\dx]{13,16}$/o
+      ||   $number =~ /^65[\dx]{14,17}$/o
+      || ( $number =~ /^62[24-68][\dx]{13,16}$/o && $Country =~ /^(US|MX|AI|AG|AW|BS|BB|BM|BQ|VG|KY|CW|DM|DO|GD|GP|JM|MQ|MS|BL|KN|LC|VC|MF|SX|TT|TC)$/oi ) #China Union Pay identified as Discover in US, Mexico and Caribbean
+      || ( $number =~ /^35(2[89]|[3-8][\dx])[\dx]{12,15}$/o && $Country =~ /^(US|PR|VI|MP|PW|GU)$/oi ); #JCB cards in the 3528-3589 range are identified as Discover in US, Puerto Rico, US Virgin Islands, Northern Mariana Islands, Palau and Guam
 
     return "Switch"
       if $number =~ /^49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})[\dx]{10}([\dx]{2,3})?$/o
       || $number =~ /^564182[\dx]{10}([\dx]{2,3})?$/o
       || $number =~ /^6(3(33[0-4][0-9])|759[0-9]{2})[\dx]{10}([\dx]{2,3})?$/o;
     #redunant with above, catch 49* that's not Switch
-    return "VISA card" if $number =~ /^4[\dx]{12}([\dx]{3})?$/o;
+    return "VISA card" if $number =~ /^4[\dx]{12,18}$/o;
 
     #return "Diner's Club/Carte Blanche"
     #  if $number =~ /^3(0[0-59]|[68][\dx])[\dx]{11}$/o;
@@ -244,6 +248,21 @@
     return "Unknown";
 }
 
+sub receipt_cardtype {
+    # Allow use as a class method
+    shift if UNIVERSAL::isa( $_[0], 'Business::CreditCard' );
+
+    my ($number) = @_;
+
+    $number =~ s/[\s\-]//go;
+    $number =~ s/[x\*\.\_]/x/gio;
+
+    #ref Discover IIN Bulletin Feb 2015_021715
+    return "PayPal card" if $number =~ /^6(01104|506[01]0)[\dx]{10,13}$/o;
+
+    cardtype($number);
+}
+
 sub generate_last_digit {
     # Allow use as a class method
     shift if UNIVERSAL::isa( $_[0], 'Business::CreditCard' );
diff -Nru libbusiness-creditcard-perl-0.33/META.json libbusiness-creditcard-perl-0.35/META.json
--- libbusiness-creditcard-perl-0.33/META.json	2014-09-14 01:14:48.000000000 +0200
+++ libbusiness-creditcard-perl-0.35/META.json	2016-02-09 23:44:17.000000000 +0100
@@ -4,7 +4,7 @@
       "unknown"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060",
+   "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150005",
    "license" : [
       "perl_5"
    ],
@@ -37,5 +37,6 @@
       }
    },
    "release_status" : "stable",
-   "version" : "0.33"
+   "version" : "0.35",
+   "x_serialization_backend" : "JSON::PP version 2.27300"
 }
diff -Nru libbusiness-creditcard-perl-0.33/META.yml libbusiness-creditcard-perl-0.35/META.yml
--- libbusiness-creditcard-perl-0.33/META.yml	2014-09-14 01:14:48.000000000 +0200
+++ libbusiness-creditcard-perl-0.35/META.yml	2016-02-09 23:44:17.000000000 +0100
@@ -7,7 +7,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060'
+generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150005'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -19,4 +19,5 @@
     - inc
 requires:
   Test::More: '0'
-version: '0.33'
+version: '0.35'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.012'
diff -Nru libbusiness-creditcard-perl-0.33/debian/changelog libbusiness-creditcard-perl-0.35/debian/changelog
--- libbusiness-creditcard-perl-0.33/debian/changelog	2016-06-26 14:52:12.000000000 +0200
+++ libbusiness-creditcard-perl-0.35/debian/changelog	2016-06-26 18:16:05.000000000 +0200
@@ -1,3 +1,11 @@
+libbusiness-creditcard-perl (0.35-0+deb8u1) UNRELEASED; urgency=medium
+
+  * Import upstream releas 0.35 to adjust to changes in credit card ranges and
+    processing of various companies.
+    (Closes: #814479)
+
+ -- gregor herrmann <gregoa@debian.org>  Tue, 07 Jun 2016 21:58:27 +0200
+
 libbusiness-creditcard-perl (0.33-1) unstable; urgency=medium
 
   * Team upload.
diff -Nru libbusiness-creditcard-perl-0.33/t/agreements.t libbusiness-creditcard-perl-0.35/t/agreements.t
--- libbusiness-creditcard-perl-0.33/t/agreements.t	2014-09-13 02:30:36.000000000 +0200
+++ libbusiness-creditcard-perl-0.35/t/agreements.t	2016-02-03 15:11:15.000000000 +0100
@@ -15,9 +15,9 @@
   my %cards = (
   '3528000000000007' => 'Discover card',
   '3589000000000003' => 'Discover card',
-  '30000000000004'   => 'Discover card',
-  '30500000000003'   => 'Discover card',
-  '30950000000000'   => 'Discover card',
+#  '30000000000004'   => 'Discover card',
+#  '30500000000003'   => 'Discover card',
+#  '30950000000000'   => 'Discover card',
   #'6200000000000005' => 'Discover card', #is 620 a valid CUP now?
   '6220000000000008' => 'Discover card',
   );
@@ -40,14 +40,23 @@
 sub test_card_id_ca {
   local($Business::CreditCard::Country) = 'CA';
 
+#  my %cards = (
+#  '3528000000000007' => 'Discover card',
+#  '3589000000000003' => 'Discover card',
+##  '30000000000004'   => 'Discover card',
+##  '30500000000003'   => 'Discover card',
+##  '30950000000000'   => 'Discover card',
+#  #'6200000000000005' => 'Discover card', #is 620 a valid CUP now?
+#  '6220000000000008' => 'Discover card',
+#  );
   my %cards = (
-  '3528000000000007' => 'Discover card',
-  '3589000000000003' => 'Discover card',
-  '30000000000004'   => 'Discover card',
-  '30500000000003'   => 'Discover card',
-  '30950000000000'   => 'Discover card',
+  '3528000000000007' => 'JCB',
+  '3589000000000003' => 'JCB',
+#  '30000000000004'   => 'Discover card',
+#  '30500000000003'   => 'Discover card',
+#  '30950000000000'   => 'Discover card',
   #'6200000000000005' => 'Discover card', #is 620 a valid CUP now?
-  '6220000000000008' => 'Discover card',
+  '6220000000000008' => 'China Union Pay',
   );
   test_cards(\%cards);
 }
@@ -59,9 +68,9 @@
   my %cards = (
   '3528000000000007' => 'JCB',
   '3589000000000003' => 'JCB',
-  '30000000000004'   => 'Discover card',
-  '30500000000003'   => 'Discover card',
-  '30950000000000'   => 'Discover card',
+#  '30000000000004'   => 'Discover card',
+#  '30500000000003'   => 'Discover card',
+#  '30950000000000'   => 'Discover card',
   #'6200000000000005' => 'Discover card', #is 620 a valid CUP now?
   '6220000000000008' => 'Discover card',
   );
@@ -74,9 +83,9 @@
   my %cards = (
   '3528000000000007' => 'JCB',
   '3589000000000003' => 'JCB',
-  '30000000000004'   => 'Discover card',
-  '30500000000003'   => 'Discover card',
-  '30950000000000'   => 'Discover card',
+#  '30000000000004'   => 'Discover card',
+#  '30500000000003'   => 'Discover card',
+#  '30950000000000'   => 'Discover card',
   #'6200000000000005' => 'Discover card', #is 620 a valid CUP now?
   '6220000000000008' => 'China Union Pay',
   );
@@ -89,9 +98,9 @@
   my %cards = (
   '3528000000000007' => 'JCB',
   '3589000000000003' => 'JCB',
-  '30000000000004'   => 'Discover card',
-  '30500000000003'   => 'Discover card',
-  '30950000000000'   => 'Discover card',
+#  '30000000000004'   => 'Discover card',
+#  '30500000000003'   => 'Discover card',
+#  '30950000000000'   => 'Discover card',
   #'6200000000000005' => 'Discover card', #is 620 a valid CUP now?
 
   #XXX this is technically an issue ("base" for CUP is still CUP)
diff -Nru libbusiness-creditcard-perl-0.33/t/test.t libbusiness-creditcard-perl-0.35/t/test.t
--- libbusiness-creditcard-perl-0.33/t/test.t	2012-06-26 01:22:26.000000000 +0200
+++ libbusiness-creditcard-perl-0.35/t/test.t	2016-02-09 23:42:46.000000000 +0100
@@ -13,19 +13,15 @@
         my %test_table=(
                 '5212345678901234' =>   'MasterCard',
                 '5512345678901234' =>   'MasterCard',
+                '2512345678901234' => 'MasterCard',
                 '4123456789012' =>      'VISA card',
+                '4929492492497' =>      'VISA card',
                 '4512345678901234' =>   'VISA card',
                 '341234567890123' =>    'American Express card',
                 '371234567890123' =>    'American Express card',
-                #'30112345678901' =>     "Diner's Club/Carte Blanche",
-                '30112345678901' =>     'Discover card',
-                #'30512345678901' =>     "Diner's Club/Carte Blanche",
-                '30512345678901' =>     'Discover card',
                 #'36123456789012' =>     "Diner's Club/Carte Blanche",
                 #'36123456789012' =>     'MasterCard',
                 '36123456789012' =>     'Discover card',
-                #'38123456789012' =>     "Diner's Club/Carte Blanche",
-                '38123456789012' =>     'Discover card',
                 '201412345678901' =>    'enRoute',
                 '214912345678901' =>    'enRoute',
                 '6011123456789012' =>   'Discover card',

Attachment: signature.asc
Description: Digital Signature


Reply to: