X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpay_batch.pm;h=9ce6a8312ccb0a7c0fb94ab6ad0b7f9020d0c92c;hb=5f8111de04a4a914c72a1642722476db4728339c;hp=3a069149f8a0342a6eab16187abc4b413d425c90;hpb=bf2769eca6c8bdcf0332e43cc654f35280624d12;p=freeside.git diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm index 3a069149f..9ce6a8312 100644 --- a/FS/FS/pay_batch.pm +++ b/FS/FS/pay_batch.pm @@ -1,21 +1,19 @@ package FS::pay_batch; +use base qw( FS::Record ); use strict; -use vars qw( @ISA $DEBUG %import_info %export_info $conf ); +use vars qw( $DEBUG %import_info %export_info $conf ); +use Scalar::Util qw(blessed); +use IO::Scalar; +use List::Util qw(sum); use Time::Local; use Text::CSV_XS; -use FS::Record qw( dbh qsearch qsearchs ); -use FS::Conf; -use FS::cust_pay; -use FS::agent; use Date::Parse qw(str2time); use Business::CreditCard qw(cardtype); -use Scalar::Util 'blessed'; -use IO::Scalar; use FS::Misc qw(send_email); # for error notification -use List::Util qw(sum); - -@ISA = qw(FS::Record); +use FS::Record qw( dbh qsearch qsearchs ); +use FS::Conf; +use FS::cust_pay; =head1 NAME @@ -147,22 +145,10 @@ sub check { Returns the L object for this batch. -=cut - -sub agent { - qsearchs('agent', { 'agentnum' => $_[0]->agentnum }); -} - =item cust_pay_batch Returns all L objects for this batch. -=cut - -sub cust_pay_batch { - qsearch('cust_pay_batch', { 'batchnum' => $_[0]->batchnum }); -} - =item rebalance =cut @@ -735,7 +721,8 @@ sub import_from_gateway { $total += $cust_pay_batch->paid; } else { - $error = $cust_pay_batch->decline($item->error_message); + $error = $cust_pay_batch->decline($item->error_message, + $item->failure_status); } if ( $error ) {