Billing type ' : '' %>
+
<%=
my $cardselect = '';
+
+ my $table = '';
my %payby = (
- 'CARD' => qq!Credit card *$cardselect *Exp !. expselect("CARD"). qq! *Name on card !,
- 'DCRD' => qq!Credit card *$cardselect *Exp !. expselect("DCRD"). qq! *Name on card !,
- 'CHEK' => qq!Electronic check ${r}Account number ${r}ABA/Routing code ${r}Bank name !,
- 'DCHK' => qq!Electronic check ${r}Account number ${r}ABA/Routing code ${r}Bank name !,
- 'LECB' => qq!Phone bill billing ${r}Phone number !,
- 'BILL' => qq!Billing P.O. *Exp !. expselect("BILL", "12-2037"). qq! *Attention !,
+ 'CARD' => qq!$table* Card type | $cardselect | * Card number | | * Expiration | !. expselect("CARD"). qq! | * Name on card | | !,
+ 'DCRD' => qq!$table* Card type | $cardselect | * Card number | | * Expiration | !. expselect("DCRD"). qq! | * Name on card | | !,
+ 'CHEK' => qq!Electronic check ${r}Account number ${r}ABA/Routing code Type {$r}Bank State ${r}Bank name !,
+ 'DCHK' => qq!Electronic check ${r}Account number Type ${r}ABA/Routing code {$r}Bank State ${r}Bank name !,
+ 'LECB' => qq!Phone bill billing ${r}Phone number !,
+ 'BILL' => qq!Billing P.O. Attention!,
'COMP' => qq!Complimentary *Approved by *Exp !. expselect("COMP"),
'PREPAY' => qq!Prepaid card *!,
);
if ( $cvv_enabled ) {
foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5
- $payby{$payby} .= qq! CVV2 (help) !;
+ my $cvv_r = $require_cvv ? '* ' : '';
+ $payby{$payby} .= qq!${cvv_r}CVV2 (help) | | !;
+ }
+ }
+ if ( $paystate_enabled ) {
+ foreach my $payby ( grep { exists $payby{$_} } qw(CHEK DCHK) ) {
+ my ($county_html, $state_html, $country_html) =
+ regionselector( {
+ prefix => "${payby}_pay",
+ default_state => $statedefault,
+ default_country => $countrydefault,
+ locales => \@cust_main_county,
+ } );
+ $payby{$payby} .= " ${r}Bank state $county_html $state_html";
}
}
my( $account, $aba ) = split('@', $payinfo);
my %paybychecked = (
- 'CARD' => qq!Credit card *$cardselect *Exp !. expselect("CARD", $paydate). qq! *Name on card !,
- 'DCRD' => qq!Credit card *$cardselect *Exp !. expselect("DCRD", $paydate). qq! *Name on card !,
- 'CHEK' => qq!Electronic check ${r}Account number ${r}ABA/Routing code ${r}Bank name !,
- 'DCHK' => qq!Electronic check ${r}Account number ${r}ABA/Routing code ${r}Bank name !,
+ 'CARD' => qq!$table* Card type | $cardselect | * Card number | | * Expiration | !. expselect("CARD", $paydate). qq! | * Name on card | | !,
+ 'DCRD' => qq!$table* Card type | $cardselect | * Card number | | * Expiration | !. expselect("DCRD", $paydate). qq! | * Name on card | | !,
+ 'CHEK' => qq!Electronic check ${r}Account number Type ${r}ABA/Routing code ${r}Bank name !,
+ 'DCHK' => qq!Electronic check ${r}Account number Type ${r}ABA/Routing code ${r}Bank name !,
'LECB' => qq!Phone bill billing ${r}Phone number !,
- 'BILL' => qq!Billing P.O. *Exp !. expselect("BILL", $paydate). qq! *Attention !,
+ 'BILL' => qq!Billing P.O. Attention!,
'COMP' => qq!Complimentary *Approved by *Exp !. expselect("COMP", $paydate),
'PREPAY' => qq!Prepaid card *!,
);
if ( $cvv_enabled ) {
foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5
- $paybychecked{$payby} .= qq! CVV2 (help) !;
+ my $cvv_r = $require_cvv ? '* ' : '';
+ $paybychecked{$payby} .= qq!${cvv_r}CVV2 (help) | | !;
+ }
+ }
+ if ( $paystate_enabled ) {
+ foreach my $payby ( grep { exists $payby{$_} } qw(CHEK DCHK) ) {
+ my ($county_html, $state_html, $country_html) =
+ regionselector( {
+ prefix => "${payby}_pay",
+ selected_county => $county,
+ selected_state => $state,
+ selected_country => $country,
+ default_state => $statedefault,
+ default_country => $countrydefault,
+ locales => \@cust_main_county,
+ } );
+ $paybychecked{$payby} .= " ${r}Bank state $county_html $state_html";
}
}
- for (@payby) {
- if ( scalar(@payby) == 1) {
- $OUT .= ''.
- qq!!.
- "$paybychecked{$_} | ";
- } else {
- $OUT .= qq! $paybychecked{$_} | !;
- } else {
- $OUT .= qq!> $payby{$_}!;
- }
+ my %payby_index = ( 'CARD' => qq/Credit Card/,
+ 'DCRD' => qq/Credit Card (no auto-charge)/,
+ 'CHEK' => qq/Check/,
+ 'DCHK' => qq/Check (no auto-charge)/,
+ 'LECB' => qq/Phone Bill Billing/,
+ 'BILL' => qq/Billing/,
+ 'COMP' => qq/Complimentary/,
+ 'PREPAY' => qq/Prepaid Card/,
+ );
+
+tie my %options, 'Tie::IxHash', ();
+
+foreach my $payby_option ( @payby ) {
+ $options{$payby_option} = $payby_index{$payby_option};
+}
+
+my $selected_layer = ( grep { $_ eq 'CARD' } @payby ) ? 'CARD' : $payby[0];
+
+HTML::Widgets::SelectLayers->new(
+ options => \%options,
+ selected_layer => $selected_layer,
+ form_name => 'dummy',
+ html_between => ' ',
+ form_action => 'dummy.cgi',
+ layer_callback => sub { my $layer = shift; return ( shift @hide_payment_fields ? '' : $paybychecked{$layer} ) . ' |