capture B:OP and B:BP failure_status values from payment attempts, #21117
[freeside.git] / httemplate / view / cust_main / payment_history / attempted_payment.html
1 <I><% mt('Payment attempt') |h %> <% $info |h %></I>
2 <%init>
3
4 my( $cust_pay_pending, %opt ) = @_;
5
6 my ($payby,$payinfo) = translate_payinfo($cust_pay_pending);
7 $payby = translate_payby($payby,$payinfo);
8 my $info = $payby ? "($payby$payinfo)" : '';
9
10 if ( $opt{'pkg-balances'} && $cust_pay_pending->pkgnum ) {
11   my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum'=>$cust_pay_pending->pkgnum } );
12   $info .= ' for '. $cust_pkg->pkg_label_long;
13 }
14
15 my $detail = '';
16 if ( $cust_pay_pending->failure_status ) {
17   $detail = $cust_pay_pending->display_status;
18   $detail .= ' (' . $cust_pay_pending->statustext . ')'
19     if $cust_pay_pending->statustext;
20 } else {
21   $detail = $cust_pay_pending->statustext;
22 }
23
24 $info .= ': '.$detail if length($detail);
25
26 </%init>