-0.00 ne 0.00. Handle both cases of ~0 when checking out to intercept and finish the transaction immediately.

This commit is contained in:
Colin Kuskie 2011-05-19 08:58:44 -07:00
parent 75c86a68f5
commit 52294139a0
2 changed files with 2 additions and 1 deletions

View file

@ -1,4 +1,5 @@
7.10.17
- fixed: Forced to use a PayDriver even with a balance of 0 in the cart.
7.10.16
- fixed #12121: typ-o Asset_Map.templateIdEditPoint

View file

@ -925,7 +925,7 @@ sub www_checkout {
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') {
if (sprintf('%.2f', abs($total + $self->calculateShopCreditDeduction($total))) eq '0.00') {
my $transaction = WebGUI::Shop::Transaction->create($session, {cart => $self});
$transaction->completePurchase('zero', 'success', 'success');
$self->onCompletePurchase;