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

Re: [ic] Changing as subroutine


Quoting Howard Lowndes (suppressed):
> On Tue, 25 Feb 2003, ACforSale Inc Sales Team wrote:
> 
> >  On Behalf Of Howard Lowndes
> > I need to change the subroutine guess_cc_type in the Vend::Order module
> > to 
> > include another selector for Australian Bankcard.
> > 
> > Is it just a case of copying the (modified) subroutine into 
> > interchange.cfg as a GlobalSub or into catalog.cfg as a Sub (and 
> > restarting Interchange of course), or is there more to setting up 
> > GlobalSub and Sub; IOW do I have to do other things to the subroutine?
> > 
> > I find the doco at 4.1 in the template guide is a bit esoteric.
> 
> 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' }

Added -- thanks.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <suppressed>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer
_______________________________________________
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.