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

RE: [ic] Changing as subroutine


Howard Lowndes suppressed wrote:
> I didn't get any success in setting up a replacement subroutine so I had 
> to settle for mod'ng the Vend::Order module to suit Australian Bankcard.  
> Here are the changes for what they are worth:
> 
> sub guess_cc_type {
>         my ($ccnum) = @_;
>         $ccnum =~ s/\D+//g;
> 
>         # based on logic by Karl Moore from http://www.vb-world.net/tips/tip509.html
>         # Australian Bankcard added by Howard Lowndes http://lannet.com.au
>         if ($ccnum eq '')                                       { '' }
>         elsif ($ccnum =~ /^4(?:\d{12}|\d{15})$/)                { 'visa' }
>         elsif ($ccnum =~ /^56\d{14}$/)                          { 'bankcard' }
>
I think the above regex may need to be changed to this:

    /^5610\d{12}$/

As far as I can tell, the Australian BankCard prefix is 5610, rather
than just 56.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    suppressed
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.