summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc')
-rwxr-xr-xhttemplate/misc/bill.cgi4
-rw-r--r--httemplate/misc/download-batch.cgi44
-rw-r--r--httemplate/misc/process/payment.cgi7
3 files changed, 9 insertions, 46 deletions
diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi
index 1532a44eb..6e4cc265d 100755
--- a/httemplate/misc/bill.cgi
+++ b/httemplate/misc/bill.cgi
@@ -1,5 +1,4 @@
%
-%
%#untaint custnum
%my($query) = $cgi->keywords;
%$query =~ /^(\d*)$/;
@@ -7,6 +6,8 @@
%my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
%die "Can't find customer!\n" unless $cust_main;
%
+%my $conf = new FS::Conf;
+%
%my $error = $cust_main->bill(
%# 'time'=>$time
% );
@@ -23,6 +24,7 @@
% #'report_badcard'=> 'yes',
% #'retry_card' => 'yes',
% 'retry' => 'yes',
+% 'realtime' => $conf->exists('realtime-backend'),
% );
%}
%#&eidiot($error) if $error;
diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi
index 038aa2049..ad88092d3 100644
--- a/httemplate/misc/download-batch.cgi
+++ b/httemplate/misc/download-batch.cgi
@@ -1,17 +1,9 @@
%
-%
%my $conf=new FS::Conf;
%
%#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes
%http_header('Content-Type' => 'text/plain' );
%
-%my $batchnum;
-%if ( $cgi->param('batchnum') =~ /^(\d+)$/ ) {
-% $batchnum = $1;
-%} else {
-% die "No batch number (bad URL) \n";
-%}
-%
%my $format;
%if ( $cgi->param('format') =~ /^([\w\- ]+)$/ ) {
% $format = $1;
@@ -23,12 +15,11 @@
%local $FS::UID::AutoCommit = 0;
%my $dbh = dbh;
%
-%my $pay_batch = qsearchs('pay_batch', {'batchnum'=>$batchnum, 'status'=>'O'} );
+%my $pay_batch = qsearchs('pay_batch', {'status'=>''} );
%die "No pending batch. \n" unless $pay_batch;
%
%my %batchhash = $pay_batch->hash;
%$batchhash{'status'} = 'I';
-%$batchhash{'download'} = time unless $batchhash{'download'};
%my $new = new FS::pay_batch \%batchhash;
%my $error = $new->replace($pay_batch);
%die "error updating batch status: $error\n" if $error;
@@ -36,10 +27,8 @@
%my $batchtotal=0;
%my $batchcount=0;
%
-%my (@date)=localtime($new->download);
-%my $jdate = sprintf("%03d", $date[5] % 100).sprintf("%03d", $date[7] + 1);
-%my $cdate = sprintf("%02d", $date[3]).sprintf("%02d", $date[4] + 1).
-% sprintf("%02d", $date[5] % 100);
+%my (@date)=localtime();
+%my $jdate = sprintf("%03d", $date[5] % 100).sprintf("%03d", $date[7]);
%
%if ($format eq "BoM") {
%
@@ -51,16 +40,6 @@
%>
%
%
-%}elsif ($format eq "PAP"){
-%
-% my($origid,$datacenter,$typecode,$shortname,$longname,$mybank,$myacct) =
-% $conf->config("batchconfig-$format");
-%
-<% sprintf( "H%10sD%3s%06u%-15s%09u%-12s%04u%19s\n",$origid,$typecode,$cdate,$shortname,$mybank,$myacct,$pay_batch->batchnum,"")
-
- %>
-%
-%
%}elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){
%# 1;
%}else{
@@ -84,14 +63,7 @@
%
% my( $account, $aba ) = split( '@', $cust_pay_batch->payinfo );
%
-<% sprintf( "D%010.0f%09u%-12s%-29s%-19s\n",$cust_pay_batch->amount*100,$aba,$account,$cust_pay_batch->payname,$cust_pay_batch->paybatchnum) %>
-%
-%
-% } elsif ($format eq "PAP"){
-%
-% my( $account, $aba ) = split( '@', $cust_pay_batch->payinfo );
-%
-<% sprintf( "D%-23s%06u%-19s%09u%-12s%010.0f\n",$cust_pay_batch->payname,$cdate,$cust_pay_batch->paybatchnum,$aba,$account,$cust_pay_batch->amount*100) %>
+<% sprintf( "D%010u%09u%-12s%-29s%-19s\n",$cust_pay_batch->amount*100,$aba,$account,$cust_pay_batch->payname,$cust_pay_batch->invnum %>
%
%
% } elsif ($format eq "csv-td_canada_trust-merchant_pc_batch") {
@@ -109,16 +81,10 @@
%if ($format eq "BoM") {
%
%
-<% sprintf( "YD%08u%014.0f%56s\n",$batchcount,$batchtotal*100,"" ).
+<% sprintf( "YD%08u%014u%56s\n",$batchcount,$batchtotal*100,"" ).
sprintf( "Z%014u%05u%014u%05u%41s\n",$batchtotal*100,$batchcount,"0","0","" ) %>
%
%
-%} elsif ($format eq "PAP"){
-%
-%
-<% sprintf( "T%08u%014.0f%57s\n",$batchcount,$batchtotal*100,"" ) %>
-%
-%
%} elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){
% #1;
%} else {
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index 188d1dd04..e1fade4e2 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -1,5 +1,4 @@
%
-%
%#some false laziness w/MyAccount::process_payment
%
%$cgi->param('custnum') =~ /^(\d+)$/
@@ -25,10 +24,6 @@
%$cgi->param('payby') =~ /^(CARD|CHEK)$/
% or die "illegal payby ". $cgi->param('payby');
%my $payby = $1;
-%my %payby2bop = (
-% 'CARD' => 'CC',
-% 'CHEK' => 'ECHECK',
-%);
%my %payby2fields = (
% 'CARD' => [ qw( address1 address2 city state zip ) ],
% 'CHEK' => [ qw( ss ) ],
@@ -87,7 +82,7 @@
% die "unknown payby $payby";
%}
%
-%my $error = $cust_main->realtime_bop( $payby2bop{$payby}, $amount,
+%my $error = $cust_main->realtime_bop( $FS::payby::payby2bop->{$payby}, $amount,
% 'quiet' => 1,
% 'payinfo' => $payinfo,
% 'paydate' => "$year-$month-01",