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' ) {
9 <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>
11 % } elsif ( $action eq 'capture' ) {
13 <CENTER><FONT SIZE="+1"><B>Captured payment not recorded in database - check logs for errors.</B></FONT></CENTER>
19 %#false laziness w/view/cust_pay.html
20 <% include('/elements/small_custview.html',
21 $cust_pay_pending->custnum,
22 scalar($conf->config('countrydefault')),
28 <% ntable("#cccccc", 2) %>
31 <TD ALIGN="right">Pending payment#</TD>
32 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->paypendingnum %></B></TD>
36 <TD ALIGN="right">Date</TD>
37 <TD BGCOLOR="#FFFFFF"><B><% time2str"%a %b %o, %Y %r", $cust_pay_pending->_date %></B></TD>
41 <TD ALIGN="right">Amount</TD>
42 <TD BGCOLOR="#FFFFFF"><B><% $money_char. $cust_pay_pending->paid %></B></TD>
46 <TD ALIGN="right">Payment method</TD>
47 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->payby_name %> #<% $cust_pay_pending->paymask %></B></TD>
50 % #if ( $cust_pay_pending->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay_pending->paybatch ) {
53 <TD ALIGN="right">Processor</TD>
54 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->processor %></B></TD>
58 <TD ALIGN="right">Authorization#</TD>
59 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->authorization %></B></TD>
62 % if ( $cust_pay_pending->order_number ) {
64 <TD ALIGN="right">Order#</TD>
65 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->order_number %></B></TD>
75 <FORM NAME = "pendingform"
77 ACTION = "process/cust_pay_pending.html"
80 <INPUT TYPE="hidden" NAME="paypendingnum" VALUE="<% $paypendingnum %>">
84 % if ( $action eq 'delete' ) {
86 <INPUT TYPE="hidden" NAME="action" VALUE="<% $action %>">
90 <BUTTON TYPE="button" onClick="document.pendingform.submit();"><!--IMG SRC="<%$p%>images/tick.png" ALT=""-->Yes, delete payment</BUTTON>
92 <TD> </TD>
94 <BUTTON TYPE="button" onClick="parent.cClick();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, cancel deletion</BUTTON>
100 %# if ( $action eq 'complete' ) {
102 <INPUT TYPE="hidden" NAME="action" VALUE="">
106 <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'insert_cust_pay'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/tick.png" ALT=""-->Yes, transaction completed sucessfully.</BUTTON>
109 % if ( $action eq 'complete' ) {
110 <TD> </TD>
112 <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'decline'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, transaction was declined</BUTTON>
114 <TD> </TD>
116 <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>
121 <TR><TD COLSPAN=5></TD></TR>
124 <TD COLSPAN=5 ALIGN="center">
125 <BUTTON TYPE="button" onClick="parent.cClick();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->Cancel payment completion; transaction status not yet known</BUTTON>
138 my $curuser = $FS::CurrentUser::CurrentUser;
141 unless $curuser->access_right('Edit customer pending payments');
143 $cgi->param('action') =~ /^(\w+)$/ or die 'illegal action';
145 my $title = ucfirst($action). ' pending payment';
147 $cgi->param('paypendingnum') =~ /^(\d+)$/ or die 'illegal paypendingnum';
148 my $paypendingnum = $1;
149 my $cust_pay_pending =
151 'select' => 'cust_pay_pending.*',
152 'table' => 'cust_pay_pending',
153 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
154 'hashref' => { 'paypendingnum' => $paypendingnum },
155 'extra_sql' => ' AND '. $curuser->agentnums_sql,
157 or die 'unknown paypendingnum';
159 my $conf = new FS::Conf;
161 my $money_char = $conf->config('money_char') || '$';