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>
15 %#false laziness w/view/cust_pay.html
16 <% include('/elements/small_custview.html',
17 $cust_pay_pending->custnum,
18 scalar($conf->config('countrydefault')),
24 <% ntable("#cccccc", 2) %>
27 <TD ALIGN="right">Pending payment#</TD>
28 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->paypendingnum %></B></TD>
32 <TD ALIGN="right">Date</TD>
33 <TD BGCOLOR="#FFFFFF"><B><% time2str"%a %b %o, %Y %r", $cust_pay_pending->_date %></B></TD>
37 <TD ALIGN="right">Amount</TD>
38 <TD BGCOLOR="#FFFFFF"><B><% $money_char. $cust_pay_pending->paid %></B></TD>
42 <TD ALIGN="right">Payment method</TD>
43 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->payby_name %> #<% $cust_pay_pending->paymask %></B></TD>
46 % #if ( $cust_pay_pending->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay_pending->paybatch ) {
49 <TD ALIGN="right">Processor</TD>
50 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->processor %></B></TD>
54 <TD ALIGN="right">Authorization#</TD>
55 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->authorization %></B></TD>
58 % if ( $cust_pay_pending->order_number ) {
60 <TD ALIGN="right">Order#</TD>
61 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->order_number %></B></TD>
71 <FORM NAME = "pendingform"
73 ACTION = "process/cust_pay_pending.html"
76 <INPUT TYPE="hidden" NAME="paypendingnum" VALUE="<% $paypendingnum %>">
80 % if ( $action eq 'delete' ) {
82 <INPUT TYPE="hidden" NAME="action" VALUE="<% $action %>">
86 <BUTTON TYPE="button" onClick="document.pendingform.submit();"><!--IMG SRC="<%$p%>images/tick.png" ALT=""-->Yes, delete payment</BUTTON>
88 <TD> </TD>
90 <BUTTON TYPE="button" onClick="parent.cClick();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, cancel deletion</BUTTON>
94 % } elsif ( $action eq 'complete' ) {
96 <INPUT TYPE="hidden" NAME="action" VALUE="">
100 <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>
102 <TD> </TD>
104 <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'decline'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, transaction was declined</BUTTON>
106 <TD> </TD>
108 <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>
112 <TR><TD COLSPAN=5></TD></TR>
115 <TD COLSPAN=5 ALIGN="center">
116 <BUTTON TYPE="button" onClick="parent.cClick();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->Cancel payment completion; transaction status not yet known</BUTTON>
129 my $curuser = $FS::CurrentUser::CurrentUser;
132 unless $curuser->access_right('Edit customer pending payments');
134 $cgi->param('action') =~ /^(\w+)$/ or die 'illegal action';
136 my $title = ucfirst($action). ' pending payment';
138 $cgi->param('paypendingnum') =~ /^(\d+)$/ or die 'illegal paypendingnum';
139 my $paypendingnum = $1;
140 my $cust_pay_pending =
142 'select' => 'cust_pay_pending.*',
143 'table' => 'cust_pay_pending',
144 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
145 'hashref' => { 'paypendingnum' => $paypendingnum },
146 'extra_sql' => ' AND '. $curuser->agentnums_sql,
148 or die 'unknown paypendingnum';
150 my $conf = new FS::Conf;
152 my $money_char = $conf->config('money_char') || '$';