summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-02-03 12:27:46 -0800
committerIvan Kohler <ivan@freeside.biz>2013-02-03 12:27:46 -0800
commit855e05d13c8fb11862a6961ceccf426939ebe5cc (patch)
treea8db4363cc61deb35ee3427a90d9504e9ef7e430
parentc1212f339a1618b139a57589af5e48a72a46d96a (diff)
parente6501937a8fc0af8583638226599e2857dd4f023 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
-rwxr-xr-xhttemplate/edit/cust_refund.cgi8
-rw-r--r--httemplate/view/cust_main/payment_history.html11
-rw-r--r--httemplate/view/cust_main/payment_history/attempted_batch_payment.html13
3 files changed, 28 insertions, 4 deletions
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi
index 656d5ebb5..df42e63ae 100755
--- a/httemplate/edit/cust_refund.cgi
+++ b/httemplate/edit/cust_refund.cgi
@@ -59,12 +59,12 @@
</TD>
</TR>
% }
-
+% if ( $cust_pay->processor ) {
<TR>
<TD ALIGN="right">Processor</TD>
<TD BGCOLOR="#ffffff"><% $cust_pay->processor %></TD>
</TR>
-% if ( length($auth) ) {
+% if ( length($cust_pay->auth) ) {
<TR>
<TD ALIGN="right">Authorization</TD>
@@ -78,10 +78,10 @@
<TD BGCOLOR="#ffffff"><% $cust_pay->order_number %></TD>
</TR>
% }
-% } #if $cust_pay
+% } # if ($cust_pay->processor)
</TABLE>
-% }
+% } #if $cust_pay
<BR>Refund
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index 8745cac87..7701cb6b0 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -501,6 +501,17 @@ foreach my $cust_pay_pending ($cust_main->cust_pay_pending_attempt) {
#'target' => $target, #XXX
};
}
+#declined batch payments
+foreach my $cust_pay_batch (
+ $cust_main->cust_pay_batch(hashref => {status => 'Declined'})
+) {
+ my $pay_batch = $cust_pay_batch->pay_batch;
+ push @history, {
+ 'date' => $pay_batch->upload,
+ 'desc' => include('payment_history/attempted_batch_payment.html', $cust_pay_batch, %opt),
+ 'void_payment' => $cust_pay_batch->amount,
+ };
+}
#credits (some false laziness w/payments)
foreach my $cust_credit ($cust_main->cust_credit) {
diff --git a/httemplate/view/cust_main/payment_history/attempted_batch_payment.html b/httemplate/view/cust_main/payment_history/attempted_batch_payment.html
new file mode 100644
index 000000000..95947f512
--- /dev/null
+++ b/httemplate/view/cust_main/payment_history/attempted_batch_payment.html
@@ -0,0 +1,13 @@
+<I><% mt('Payment attempt') |h %> <% $info |h %></I>
+<%init>
+
+my( $cust_pay_batch, %opt ) = @_;
+
+my ($payby,$payinfo) = translate_payinfo($cust_pay_batch);
+$payby = translate_payby($payby,$payinfo);
+my $info = $payby ? "($payby$payinfo)" : '';
+
+$info .= ': '. $cust_pay_batch->error_message
+ if length($cust_pay_batch->error_message);
+
+</%init>