don't show duplicate 'Credit card' or 'Check' choices even when signup_server-payby...
authorivan <ivan>
Tue, 20 Oct 2009 18:30:13 +0000 (18:30 +0000)
committerivan <ivan>
Tue, 20 Oct 2009 18:30:13 +0000 (18:30 +0000)
fs_selfservice/FS-SelfService/cgi/change_pay.html

index e7a9969..bbe4527 100644 (file)
   $options{$payby} = $payby_index{$payby}
     unless exists($options{$payby});
 
+  #don't want to show multiple "Credit card" or "Check" options
+  my %paybyremove = (
+    'CARD' => 'DCRD',
+    'DCRD' => 'CARD',
+    'CHEK' => 'DCHK',
+    'DCHK' => 'CHEK',
+  );
+  delete( $options{ $paybyremove{$payby} } );
+  delete $options{'DCRD'} unless $payby eq 'DCRD' || ! exists $options{'CARD'};
+  delete $options{'DCHK'} unless $payby eq 'DCHK' || ! exists $options{'CHEK'};
+
   HTML::Widgets::SelectLayers->new(
     options => \%options,
     selected_layer => $payby,