1 <% include('/elements/header-popup.html', $title ) %>
3 % if ( $action eq 'delete' ) {
5 <CENTER><FONT SIZE="+1"><B>Are you sure you want to delete this pending payment?</B></FONT></CENTER>
7 % } elsif (( $action eq 'complete' ) and $authorized) {
9 <CENTER><FONT SIZE="+1"><B>Payment was authorized but not captured. Contact <% $cust_pay_pending->processor || 'the payment gateway' %> to establish the final disposition of this transaction.</B></FONT></CENTER>
11 % } elsif ( $action eq 'complete' ) {
13 <CENTER><FONT SIZE="+1"><B>No response was received from <% $cust_pay_pending->processor || 'the payment gateway' %> for this transaction. Check <% $cust_pay_pending->processor || 'the payment gateway' %>'s reporting and determine if this transaction completed successfully.</B></FONT></CENTER>
15 % } elsif ( $action eq 'capture' ) {
17 <CENTER><FONT SIZE="+1"><B>Captured payment not recorded in database - check logs for errors.</B></FONT></CENTER>
23 %#false laziness w/view/cust_pay.html
24 <% include('/elements/small_custview.html',
25 $cust_pay_pending->custnum,
26 scalar($conf->config('countrydefault')),
32 <% ntable("#cccccc", 2) %>
35 <TD ALIGN="right">Pending payment#</TD>
36 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->paypendingnum %></B></TD>
40 <TD ALIGN="right">Date</TD>
41 <TD BGCOLOR="#FFFFFF"><B><% time2str"%a %b %o, %Y %r", $cust_pay_pending->_date %></B></TD>
45 <TD ALIGN="right">Amount</TD>
46 <TD BGCOLOR="#FFFFFF"><B><% $money_char. $cust_pay_pending->paid %></B></TD>
50 <TD ALIGN="right">Payment method</TD>
51 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->payby_name %> #<% $cust_pay_pending->paymask %></B></TD>
54 % #if ( $cust_pay_pending->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay_pending->paybatch ) {
57 <TD ALIGN="right">Processor</TD>
58 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->processor %></B></TD>
62 <TD ALIGN="right">Authorization#</TD>
63 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->authorization %></B></TD>
66 % if ( $cust_pay_pending->order_number ) {
68 <TD ALIGN="right">Order#</TD>
69 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->order_number %></B></TD>
79 <FORM NAME = "pendingform"
81 ACTION = "process/cust_pay_pending.html"
84 <INPUT TYPE="hidden" NAME="paypendingnum" VALUE="<% $paypendingnum %>">
88 % if ( $action eq 'delete' ) {
90 <INPUT TYPE="hidden" NAME="action" VALUE="<% $action %>">
94 <BUTTON TYPE="button" onClick="document.pendingform.submit();"><!--IMG SRC="<%$p%>images/tick.png" ALT=""-->Yes, delete payment</BUTTON>
96 <TD> </TD>
98 <BUTTON TYPE="button" onClick="parent.cClick();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, cancel deletion</BUTTON>
104 <INPUT TYPE="hidden" NAME="action" VALUE="">
108 <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'insert_cust_pay'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/tick.png" ALT=""-->Yes, transaction completed successfully.</BUTTON>
111 % if ( $action eq 'complete' ) {
112 <TD> </TD>
115 <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'reverse'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, transaction was reversed</BUTTON>
119 <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'decline'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, transaction was declined</BUTTON>
122 <TD> </TD>
124 <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'delete'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, transaction was not received</BUTTON>
130 <TR><TD COLSPAN=5></TD></TR>
133 <TD COLSPAN=5 ALIGN="center">
134 <BUTTON TYPE="button" onClick="parent.cClick();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->Cancel payment completion; transaction status not yet known</BUTTON>
147 my $curuser = $FS::CurrentUser::CurrentUser;
150 unless $curuser->access_right('Edit customer pending payments');
152 $cgi->param('action') =~ /^(\w+)$/ or die 'illegal action';
154 my $title = ucfirst($action). ' pending payment';
156 $cgi->param('paypendingnum') =~ /^(\d+)$/ or die 'illegal paypendingnum';
157 my $paypendingnum = $1;
158 my $cust_pay_pending =
160 'select' => 'cust_pay_pending.*',
161 'table' => 'cust_pay_pending',
162 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
163 'hashref' => { 'paypendingnum' => $paypendingnum },
164 'extra_sql' => ' AND '. $curuser->agentnums_sql,
166 or die 'unknown paypendingnum';
168 my $authorized = ($cust_pay_pending->status eq 'authorized') ? 1 : 0;
170 my $conf = new FS::Conf;
172 my $money_char = $conf->config('money_char') || '$';