From f63c0e821610c885f9f49d301eeccf804e1ca6d3 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 24 Oct 2003 19:30:44 +0000 Subject: cvv! --- httemplate/docs/cvv2.html | 25 +++++++++++++++++++++++ httemplate/docs/schema.html | 1 + httemplate/docs/upgrade10.html | 4 +++- httemplate/edit/cust_main.cgi | 37 +++++++++++++++++++++++++++++++++-- httemplate/edit/process/cust_main.cgi | 8 ++++++++ 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 httemplate/docs/cvv2.html (limited to 'httemplate') diff --git a/httemplate/docs/cvv2.html b/httemplate/docs/cvv2.html new file mode 100644 index 000000000..fe8a17f6f --- /dev/null +++ b/httemplate/docs/cvv2.html @@ -0,0 +1,25 @@ + + + + CVV2 information + + + + The CVV2 number (also called CVC2 or CID) is a three- or four-digit + security code used to reduce credit card fraud.

+ + + + + + + + +
Visa / MasterCard / DiscoverAmerican Express
+ Visa/MasterCard/Discover + + American Express +
+
(close window)
+ + diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html index bef567186..06be8960d 100644 --- a/httemplate/docs/schema.html +++ b/httemplate/docs/schema.html @@ -121,6 +121,7 @@
  • ship_fax
  • payby - CARD, DCHK, CHEK, DCHK, LECB, BILL, or COMP
  • payinfo - card number, P.O.#, or comp issuer +
  • paycvv - Card Verification Value, "CVV2" (also known as CVC2 or CID), the 3 or 4 digit number on the back (or front, for American Express) of the credit card
  • paydate - expiration date
  • payname - billing name (name on card)
  • tax - tax exempt, Y or null diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html index 446090503..080528bac 100644 --- a/httemplate/docs/upgrade10.html +++ b/httemplate/docs/upgrade10.html @@ -1,7 +1,7 @@
     this is incomplete
     
    -install DBIx::DBSchema 0.21
    +install DBIx::DBSchema 0.22
     
     install NetAddr::IP and Chart::Base
     
    @@ -142,6 +142,8 @@ ALTER TABLE agent ADD username varchar(80) NULL;
     ALTER TABLE h_agent ADD username varchar(80) NULL;
     ALTER TABLE agent ADD _password varchar(80) NULL;
     ALTER TABLE h_agent ADD _password varchar(80) NULL;
    +ALTER TABLE cust_main ADD paycvv varchar(4) NULL;
    +ALTER TABLE h_cust_main ADD paycvv varchar(4) NULL;
     
     dump database, edit:
     - cust_main: increase otaker from 8 to 32
    diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
    index 73a0eef49..1909b5438 100755
    --- a/httemplate/edit/cust_main.cgi
    +++ b/httemplate/edit/cust_main.cgi
    @@ -39,6 +39,12 @@ if ( $cgi->param('error') ) {
       $query =~ /^(\d+)$/;
       $custnum=$1;
       $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
    +  if ( $cust_main->dbdef_table->column('paycvv')
    +       && length($cust_main->paycvv)             ) {
    +    my $paycvv = $cust_main->paycvv;
    +    $paycvv =~ s/./*/g;
    +    $cust_main->paycvv($paycvv);
    +  }
       $saved_pkgpart = 0;
       $username = '';
       $password = '';
    @@ -61,7 +67,7 @@ my $action = $custnum ? 'Edit' : 'Add';
     # top
     
     my $p1 = popurl(1);
    -print header("Customer $action", '');
    +print header("Customer $action", '', ' onUnload="myclose()"');
     print qq!Error: !, $error, ""
       if $error;
     
    @@ -400,7 +406,19 @@ if ( $payby_default eq 'HIDE' ) {
       print qq!Email invoice !;
     
       print "Billing type",
    -        "",
    +        "", '',
             &table("#cccccc"), "";
     
       my($payinfo, $payname)=(
    @@ -418,6 +436,12 @@ if ( $payby_default eq 'HIDE' ) {
         'COMP' => qq!Complimentary
    ${r}Approved by
    ${r}Exp !. expselect("COMP"), ); + if ( $cust_main->dbdef_table->column('paycvv') ) { + foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 bs + $payby{$payby} .= qq!
    CVV2 (help!; + } + } + my( $account, $aba ) = split('@', $payinfo); my %paybychecked = ( @@ -430,6 +454,15 @@ if ( $payby_default eq 'HIDE' ) { 'COMP' => qq!Complimentary
    ${r}Approved by
    ${r}Exp !. expselect("COMP", $cust_main->paydate), ); + if ( $cust_main->dbdef_table->column('paycvv') ) { + my $paycvv = $cust_main->paycvv; + + foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 bs + $paybychecked{$payby} .= qq!
    CVV2 (help!; + } + } + + $cust_main->payby($payby_default) unless $cust_main->payby; for (qw(CARD DCRD CHEK DCHK LECB BILL COMP)) { print qq!param('paydate', $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); $cgi->param('payname', $cgi->param( $payby. '_payname' ) ); + $cgi->param('paycvv', $cgi->param( $payby. '_paycvv' ) ) + if defined $cgi->param( $payby. '_paycvv' ); } $cgi->param('otaker', &getotaker ); @@ -27,6 +29,7 @@ my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); $cgi->param('invoicing_list', join(',', @invoicing_list) ); + #create new record object my $new = new FS::cust_main ( { @@ -113,6 +116,11 @@ if ( $new->custnum eq '' ) { } else { #create old record object my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); $error ||= "Old record not found!" unless $old; + if ( defined dbdef->table('cust_main')->column('paycvv') + && length($old->paycvv) + && $new->paycvv =~ /^\s*\*+\s*$/ ) { + $new->paycvv($old->paycvv); + } $error ||= $new->replace($old, \@invoicing_list); } -- cgit v1.2.1