projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1878b3d
)
prevent B:BP batches from being marked in-transit if uploading the batch fails, ...
author
Mark Wells
<mark@freeside.biz>
Fri, 16 Dec 2016 19:57:52 +0000
(11:57 -0800)
committer
Mark Wells
<mark@freeside.biz>
Sat, 17 Dec 2016 00:42:02 +0000
(16:42 -0800)
FS/FS/pay_batch.pm
patch
|
blob
|
history
diff --git
a/FS/FS/pay_batch.pm
b/FS/FS/pay_batch.pm
index
1049751
..
4aeb331
100644
(file)
--- a/
FS/FS/pay_batch.pm
+++ b/
FS/FS/pay_batch.pm
@@
-14,6
+14,7
@@
use FS::Record qw( dbh qsearch qsearchs );
use FS::Conf;
use FS::cust_pay;
use FS::Log;
use FS::Conf;
use FS::cust_pay;
use FS::Log;
+use Try::Tiny;
=head1 NAME
=head1 NAME
@@
-1086,16
+1087,21
@@
sub export_to_gateway {
return '';
}
return '';
}
- my $batch = Business::BatchPayment->create(Batch =>
- batch_id => $self->batchnum,
- items => \@items
- );
- $processor->submit($batch);
+ try {
+ my $batch = Business::BatchPayment->create(Batch =>
+ batch_id => $self->batchnum,
+ items => \@items
+ );
+ $processor->submit($batch);
- if ($batch->processor_id) {
- $self->set('processor_id',$batch->processor_id);
- $self->replace;
- }
+ if ($batch->processor_id) {
+ $self->set('processor_id',$batch->processor_id);
+ $self->replace;
+ }
+ } catch {
+ $dbh->rollback if $oldAutoCommit;
+ die $_;
+ };
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
'';
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
'';