summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/payment_history/attempted_payment.html
blob: 63209c7c72657751c5873903c3174d63bbdb5eb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<I><% mt('Payment attempt') |h %> <% $info |h %></I>
<%init>

my( $cust_pay_pending, %opt ) = @_;

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 ) {
  my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum'=>$cust_pay_pending->pkgnum } );
  $info .= ' for '. $cust_pkg->pkg_label_long;
}

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>