- Fixed a typo in testEnvironment.pl version number for DBD::mysql

- Fixed a Recurring Payments processing bug: illegal division by zero
This commit is contained in:
JT Smith 2007-01-29 22:57:55 +00:00
parent b92da4afab
commit b806163b1e
3 changed files with 9 additions and 2 deletions

View file

@ -94,7 +94,12 @@ sub execute {
my $item = WebGUI::Commerce::Item->new($self->session, $itemProperties->{itemId}, $itemProperties->{itemType});
my $time = time;
$time -= $transaction->get('initDate');
my $term = int($time / $self->getDuration($item->duration)) + 1;
my $itemDuration = $self->getDuration($item->duration);
unless ($itemDuration) {
push(@fatal, $itemProperties->{itemId}." has no duration");
next;
}
my $term = int($time / $itemDuration) + 1;
if ($term > $transaction->lastPayedTerm) {
my $payment = WebGUI::Commerce::Payment->load($self->session, $transaction->gateway);
$transaction->gatewayId;