From 26119738eaf2b519d91c855c23986f873303887f Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 16 Mar 2009 07:14:29 +0000 Subject: [PATCH] allow country selection on credit card entry, RT#4997 --- httemplate/elements/location.html | 19 +++++----- httemplate/misc/payment.cgi | 59 +++++++---------------------- httemplate/misc/process/payment.cgi | 2 +- 3 files changed, 24 insertions(+), 56 deletions(-) diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index d7b73a220..6691bc84e 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -3,20 +3,21 @@ Example: include( '/elements/location.html', - 'object' => $cust_main, # or $cust_location - 'prefix' => $pre, #only for cust_main objects - 'onchange' => $javascript, - 'disabled' => $disabled, - 'same_checked' => $same_checked, - 'geocode' => $geocode, #passed through - 'no_asterisks' => 0, #set true to disable the red asterisks next - #to required fields + 'object' => $cust_main, # or $cust_location + 'prefix' => $pre, #only for cust_main objects + 'onchange' => $javascript, + 'disabled' => $disabled, + 'same_checked' => $same_checked, + 'geocode' => $geocode, #passed through + 'no_asterisks' => 0, #set true to disable the red asterisks next + #to required fields + 'address1_label' => 'Address', #label for address ) - <%$r%>Address + <%$r%><% $opt{'address1_label'} || 'Address' %> - Payment amount + Payment amount - - +
$"> @@ -24,11 +24,6 @@ % % my( $payinfo, $paycvv, $month, $year ) = ( '', '', '', '' ); % my $payname = $cust_main->first. ' '. $cust_main->getfield('last'); -% my $address1 = $cust_main->address1; -% my $address2 = $cust_main->address2; -% my $city = $cust_main->city; -% my $state = $cust_main->state; -% my $zip = $cust_main->zip; % if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { % $payinfo = $cust_main->paymask; % $paycvv = $cust_main->paycvv; @@ -37,13 +32,13 @@ % }
Card number + Card number - + - + - + - - - - - - - - - + <% include( '/elements/location.html', + 'object' => $cust_main, #XXX errors??? + 'no_asterisks' => 1, + 'address1_label' => 'Card billing address', + ) + %> + % } elsif ( $payby eq 'CHEK' ) { % % my( $payinfo1, $payinfo2, $payname, $ss, $paytype, $paystate, diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 2baca1e39..ea0c7946d 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -44,7 +44,7 @@ $cgi->param('payby') =~ /^(CARD|CHEK)$/ or errorpage("illegal payby ". $cgi->param('payby')); my $payby = $1; my %payby2fields = ( - 'CARD' => [ qw( address1 address2 city state zip ) ], + 'CARD' => [ qw( address1 address2 city county state zip country ) ], 'CHEK' => [ qw( ss paytype paystate stateid stateid_state ) ], ); my %type = ( 'CARD' => 'credit card', -- 2.20.1
Exp.Exp.
CVV2CVV2 (help)
Exact name on cardExact name on card
Card billing address - -
Address line 2 - -
City - - - - - - - - -
- - State - - Zip - -
-