Document how and why we handle $0 checkouts

This commit is contained in:
Colin Kuskie 2010-04-30 08:51:30 -07:00
parent d986496131
commit 9ab13fb524

View file

@ -911,6 +911,8 @@ sub www_update {
}
if ($self->readyForCheckout()) {
my $total = $self->calculateTotal;
##Handle rounding errors, and checkout immediately if the amount is 0 since
##at least the ITransact driver won't accept $0 checkout.
if (sprintf('%.2f', $total + $self->calculateShopCreditDeduction($total)) eq '0.00') {
my $transaction = WebGUI::Shop::Transaction->create($session, {self => $self});
$transaction->completePurchase('zero', 'success', 'success');