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 = mt("ABA [_1], Acct #[_2]",$aba,$account);
-} else {
- $payinfo = $cust_pay_pending->payinfo;
-}
-
+my ($payby,$payinfo) = translate_payinfo($cust_pay_pending);
$payby = translate_payby($payby,$payinfo);
my $info = $payby ? "($payby$payinfo)" : '';
$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>