X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2Fcgi%2Fchange_pay.html;h=bd64907e25def549e5c688a0ab85642c129888bf;hb=2a82381a976c22f2c0d85645e8b327713ddcbd88;hp=6898dc7f86d37293f8be5d4bcd84204b0d0343f9;hpb=3564f619654c5cbf22fc2acbe7eff0c08308e859;p=freeside.git diff --git a/fs_selfservice/FS-SelfService/cgi/change_pay.html b/fs_selfservice/FS-SelfService/cgi/change_pay.html index 6898dc7f8..bd64907e2 100644 --- a/fs_selfservice/FS-SelfService/cgi/change_pay.html +++ b/fs_selfservice/FS-SelfService/cgi/change_pay.html @@ -37,6 +37,11 @@ '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}; @@ -55,12 +60,15 @@ 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 ''.$paybychecked{$layer}.qq!$tail!; }, + layer_callback => sub { my $layer = shift; use MyLog; use Data::Dumper; MyLog->mylog("my layer $layer\n"); return '
'.$paybychecked{$layer}.qq!$tail!; }, )->html; %>