projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
21891ab
)
Business::BatchPayment fixes for TD EFT format, #17878
author
Mark Wells
<mark@freeside.biz>
Wed, 8 Aug 2012 01:39:05 +0000
(18:39 -0700)
committer
Mark Wells
<mark@freeside.biz>
Wed, 8 Aug 2012 01:39:05 +0000
(18:39 -0700)
FS/FS/Cron/pay_batch.pm
patch
|
blob
|
history
FS/FS/pay_batch.pm
patch
|
blob
|
history
FS/FS/pay_batch/td_eft1464.pm
patch
|
blob
|
history
httemplate/edit/payment_gateway.html
patch
|
blob
|
history
httemplate/search/elements/cust_pay_batch_top.html
patch
|
blob
|
history
diff --git
a/FS/FS/Cron/pay_batch.pm
b/FS/FS/Cron/pay_batch.pm
index
c7cedaf
..
0ab37dd
100644
(file)
--- a/
FS/FS/Cron/pay_batch.pm
+++ b/
FS/FS/Cron/pay_batch.pm
@@
-103,7
+103,7
@@
sub batch_receive {
if ( $gateway->batch_processor->can('default_transport') ) {
warn "Importing results from '".$gateway->label."'\n" if $DEBUG;
$error = eval {
if ( $gateway->batch_processor->can('default_transport') ) {
warn "Importing results from '".$gateway->label."'\n" if $DEBUG;
$error = eval {
- FS::pay_batch->import_from_gateway( $gateway, debug => $DEBUG )
+ FS::pay_batch->import_from_gateway(
gateway =>
$gateway, debug => $DEBUG )
} || $@;
if ( $error ) {
# this we can roll back
} || $@;
if ( $error ) {
# this we can roll back
diff --git
a/FS/FS/pay_batch.pm
b/FS/FS/pay_batch.pm
index
813d096
..
e98cf5a
100644
(file)
--- a/
FS/FS/pay_batch.pm
+++ b/
FS/FS/pay_batch.pm
@@
-807,8
+807,8
@@
sub try_to_resolve {
}
);
}
);
- if ( @unresolved ) {
- my $days = $conf->config('batch-auto_resolve_days')
|| '';
+ if ( @unresolved
and $conf->exists('batch-auto_resolve_days')
) {
+ my $days = $conf->config('batch-auto_resolve_days')
; # can be zero
# either 'approve' or 'decline'
my $action = $conf->config('batch-auto_resolve_status') || '';
return unless
# either 'approve' or 'decline'
my $action = $conf->config('batch-auto_resolve_status') || '';
return unless
@@
-861,6
+861,9
@@
sub prepare_for_export {
return "error updating pay_batch status: $error\n" if $error;
} elsif ($status eq 'I' && $curuser->access_right('Reprocess batches')) {
$first_download = 0;
return "error updating pay_batch status: $error\n" if $error;
} elsif ($status eq 'I' && $curuser->access_right('Reprocess batches')) {
$first_download = 0;
+ } elsif ($status eq 'R' &&
+ $curuser->access_right('Redownload resolved batches')) {
+ $first_download = 0;
} else {
die "No pending batch.\n";
}
} else {
die "No pending batch.\n";
}
@@
-1080,7
+1083,7
@@
sub _upgrade_data {
for my $format (keys %export_info) {
my $mod = "FS::pay_batch::$format";
if ( $mod->can('_upgrade_gateway')
for my $format (keys %export_info) {
my $mod = "FS::pay_batch::$format";
if ( $mod->can('_upgrade_gateway')
- and
length
( $conf->config("batchconfig-$format") ) ) {
+ and
exists
( $conf->config("batchconfig-$format") ) ) {
local $@;
my ($module, %gw_options) = $mod->_upgrade_gateway;
local $@;
my ($module, %gw_options) = $mod->_upgrade_gateway;
@@
-1109,7
+1112,7
@@
sub _upgrade_data {
# and if appropriate, make it the system default
for my $payby (qw(CARD CHEK)) {
# and if appropriate, make it the system default
for my $payby (qw(CARD CHEK)) {
- if (
$conf->config("batch-fixed_format-$payby"
) eq $format ) {
+ if (
($conf->config("batch-fixed_format-$payby") || ''
) eq $format ) {
warn "Setting as default for $payby.\n";
$conf->set("batch-gateway-$payby", $gateway->gatewaynum);
$conf->delete("batch-fixed_format-$payby");
warn "Setting as default for $payby.\n";
$conf->set("batch-gateway-$payby", $gateway->gatewaynum);
$conf->delete("batch-fixed_format-$payby");
diff --git
a/FS/FS/pay_batch/td_eft1464.pm
b/FS/FS/pay_batch/td_eft1464.pm
index
3a6befe
..
93612f1
100644
(file)
--- a/
FS/FS/pay_batch/td_eft1464.pm
+++ b/
FS/FS/pay_batch/td_eft1464.pm
@@
-154,5
+154,14
@@
$name = 'td_eft1464';
},
);
},
);
+sub _upgrade_gateway {
+ my $conf = FS::Conf->new;
+ my @batchconfig = $conf->config('batchconfig-td_eft1464');
+ my %options;
+ @options{ qw(originator datacentre short_name long_name return_branch
+ return_account cpa_code) } = @batchconfig;
+ ( 'TD_EFT', %options );
+}
+
1;
1;
diff --git
a/httemplate/edit/payment_gateway.html
b/httemplate/edit/payment_gateway.html
index
e5897b0
..
dfe52f1
100644
(file)
--- a/
httemplate/edit/payment_gateway.html
+++ b/
httemplate/edit/payment_gateway.html
@@
-91,6
+91,7
@@
my %modules = (
'KeyBank' => 'Business::BatchPayment',
'Paymentech' => 'Business::BatchPayment',
'KeyBank' => 'Business::BatchPayment',
'Paymentech' => 'Business::BatchPayment',
+ 'TD_EFT' => 'Business::BatchPayment',
);
my %modules_for_namespace;
);
my %modules_for_namespace;
@@
-141,7
+142,7
@@
my $fields = [
{
field => 'gateway_options',
type => 'textarea',
{
field => 'gateway_options',
type => 'textarea',
- rows => '
8
',
+ rows => '
12
',
cols => '40',
curr_value_callback => sub { my($cgi, $object, $fref) = @_;
join("\r", $object->options );
cols => '40',
curr_value_callback => sub { my($cgi, $object, $fref) = @_;
join("\r", $object->options );
diff --git
a/httemplate/search/elements/cust_pay_batch_top.html
b/httemplate/search/elements/cust_pay_batch_top.html
index
739e65b
..
1dcc37a
100644
(file)
--- a/
httemplate/search/elements/cust_pay_batch_top.html
+++ b/
httemplate/search/elements/cust_pay_batch_top.html
@@
-33,6
+33,7
@@
Download batch in format <SELECT NAME="format">
'action' => "${p}misc/upload-batch.cgi",
'num_files' => 1,
'fields' => [ 'batchnum', 'format', 'gatewaynum' ],
'action' => "${p}misc/upload-batch.cgi",
'num_files' => 1,
'fields' => [ 'batchnum', 'format', 'gatewaynum' ],
+ 'url' => $cgi->self_url,
'message' => 'Batch results uploaded.',
) %>
Upload results<BR></TR>
'message' => 'Batch results uploaded.',
) %>
Upload results<BR></TR>
@@
-87,7
+88,7
@@
Batch is <% $statustext{$status} %><BR>
<%def .select_gateway>
% if ( $show_gateways ) {
<%def .select_gateway>
% if ( $show_gateways ) {
- or f
rom
gateway
+ or f
or
gateway
<& /elements/select-table.html,
empty_label => ' ',
field => 'gatewaynum',
<& /elements/select-table.html,
empty_label => ' ',
field => 'gatewaynum',