default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / view / cust_main / payment_history / attempted_payment.html
index 554aa73..63209c7 100644 (file)
@@ -1,33 +1,10 @@
-<I>Payment attempt <% $info |h %></I>
+<I><% mt('Payment attempt') |h %> <% $info |h %></I>
 <%init>
 
 my( $cust_pay_pending, %opt ) = @_;
 
-my $date_format = $opt{'date_format'} || '%m/%d/%Y';
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-my $payby = $cust_pay_pending->payby;
-
-my $payinfo;
-if ( $payby eq 'CARD' ) {
-  $payinfo = $cust_pay_pending->paymask;
-} elsif ( $payby eq 'CHEK' ) {
-  my( $account, $aba ) = split('@', $cust_pay_pending->paymask );
-  $payinfo = "ABA $aba, Acct #$account";
-} else {
-  $payinfo = $cust_pay_pending->payinfo;
-}
-
-$payby =~ s/^BILL$/Check #/ if $payinfo;
-$payby =~ s/^CHEK$/Electronic check /;
-$payby =~ s/^PREP$/Prepaid card /;
-$payby =~ s/^CARD$/Credit card #/; 
-$payby =~ s/^COMP$/Complimentary by /; 
-$payby =~ s/^CASH$/Cash/;
-$payby =~ s/^WEST$/Western Union/;
-$payby =~ s/^MCRD$/Manual credit card/;
-$payby =~ s/^BILL$//;
+my ($payby,$payinfo) = translate_payinfo($cust_pay_pending);
+$payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
 
 if ( $opt{'pkg-balances'} && $cust_pay_pending->pkgnum ) {
@@ -35,7 +12,15 @@ if ( $opt{'pkg-balances'} && $cust_pay_pending->pkgnum ) {
   $info .= ' for '. $cust_pkg->pkg_label_long;
 }
 
-$info .= ': '. $cust_pay_pending->statustext
-  if length($cust_pay_pending->statustext);
+my $detail = '';
+if ( $cust_pay_pending->failure_status ) {
+  $detail = $cust_pay_pending->display_status;
+  $detail .= ' (' . $cust_pay_pending->statustext . ')'
+    if $cust_pay_pending->statustext;
+} else {
+  $detail = $cust_pay_pending->statustext;
+}
+
+$info .= ': '.$detail if length($detail);
 
 </%init>