[ic] What do I change to put credit card numbers in database?

Murray Gibbins Murray@scotweb.ltd.uk
Tue, 06 Mar 2001 15:36:05 +0000

Robert Smith wrote:
> Hello,
>     What do I need to change to get Interchange to put credit card numbers
> directly in a database? Do I need to do some Perl work, and if so, on what
> file? I really need to be able to do this...
> Thanks!
> Robert Smith

simple, when checking the creditcard number is valid use DBI to put it into a

for example when I check some thing I use this in interchange.cfg....

GlobalSub <<EOF
sub set_up_extra_check {
        BEGIN {
            package Vend::Order;
            sub _check_copy_and_ship_address {


                # $ref is to Vend::Session->{'values'} hash
                # $var is the passed name of the variable
                # $val is current value of checked variable
                my($ref, $var, $val) = @_;

                #::logDebug("\$var = $var");
                #::logDebug("\$val = $val");            
                if(( $var eq "copy") && ($val =~ /billing/oi)){
                    return 1,"copy","Ouch, not copy";

                    my @array = (0,"Ship Address","Ouch not copy");

                    return @array if !$ref->{shipname};
                    return @array if !$ref->{shipemail};
                    return @array if !$ref->{shipaddress};
                    return @array if !$ref->{shipcity};
                    return @array if !$ref->{shipzip};

                    return (1,"Ship Address","Ouch not copy");
                return (0,"Ship Address","Ouch not copy");




so order profile look like this...
copy=check_copy_and_ship_address We need to know your copy


You do something simular but you might want to pipe it through gpg first, and
put a "use DBI" in it, etc

Or just find the code in Order.pm that deals with credit cards and put in a
couple of lines, one pipeing it through gpg the other saving it to a DB.




  \__/    Murray Gibbins             murray@scotweb.ltd.uk
  /  \    Programmer
_ \__/ _  ================================================
\\ || //  Scotweb Limited,             info@scotweb.ltd.uk
 \\||//   13a Albert Terrace,    http://www.scotweb.ltd.uk
  \||/    Edinburgh EH10 5EA   Tel: +44 (0)  131 270 82 33
   ||     Scotland. Europe.    Fax: +44 (0) 7020  93 49 04