-<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('header') %>
+<%= include('header', 'Change payment information') %>
-<FONT SIZE=4>Change payment information</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT><BR><BR>!;
} ''; %>
my $preauto = '<TR><TD COLSPAN=3><INPUT TYPE="checkbox" NAME="auto" VALUE="1"';
my $postauto = '>Charge future payments to this card automatically</TD></TR>';
- my $tail = qq(</TABLE><INPUT TYPE="hidden" NAME="session" VALUE="$session_id">).
+ my $tail = qq(</TABLE>).
qq(<INPUT TYPE="hidden" NAME="action" VALUE="process_change_pay">).
qq(<BR>).
qq(<INPUT TYPE="submit" NAME="process" ).
'PREP' => qq/Prepaid Card/,
'PREPAY' => qq/Prepaid Card/,
);
+
+ ## Don't show CHEK or DCHK option if ACH is read only
+ delete( $payby_index{'CHEK'} ) unless !$ach_read_only;
+ delete( $payby_index{'DCHK'} ) unless !$ach_read_only;
+
tie my %options, 'Tie::IxHash', ();
foreach my $payby_option ( grep { exists( $payby_index{$_} ) } @paybys ) {
$options{$payby_option} = $payby_index{$payby_option};
delete $options{'DCRD'} unless $payby eq 'DCRD' || ! exists $options{'CARD'};
delete $options{'DCHK'} unless $payby eq 'DCHK' || ! exists $options{'CHEK'};
+ ## set default layer to first payby.
+ @p = keys %options; $payby = $p[0];
+
HTML::Widgets::SelectLayers->new(
options => \%options,
selected_layer => $payby,
# form_name => 'dummy',
# form_action => 'dummy.cgi',
- layer_callback => sub { my $layer = shift; return '<TABLE BGCOLOR="#cccccc">'.$paybychecked{$layer}.qq!<INPUT TYPE="hidden" NAME="payby" VALUE="$layer">$tail!; },
+ layer_callback => sub { my $layer = shift; use MyLog; use Data::Dumper; MyLog->mylog("my layer $layer\n"); return '<TABLE BGCOLOR="#cccccc">'.$paybychecked{$layer}.qq!<INPUT TYPE="hidden" NAME="payby" VALUE="$layer">$tail!; },
)->html;
%>