From 4b3f81e3a0255e6b24a657a07967cd12a6bc2add Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 18 May 2009 23:33:14 +0000 Subject: [PATCH] ITransact requires that money amounts in XML have 2 decimal places. --- docs/changelog/7.x.x.txt | 4 ++-- lib/WebGUI/Shop/PayDriver/ITransact.pm | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f0732a868..5a2d7b9f9 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -10,8 +10,8 @@ - added Google Maps asset - added a way for authors to prevent debugging output on page requests - added --noprompt option to testEnvironment.pl to automatically install modules - - added FilePump, a way to reduce Yslow scores by minimizing JS, CSS and the - number of files transferred. + - added FilePump, a way to reduce Yslow scores by minimizing JS, CSS and the number of files transferred. + - fixed #10394: CC Purchases Fail When Variants Contain Trailing Zero(s) 7.7.6 - Added mobile style template. If enabled in settings, will serve alternate style templates diff --git a/lib/WebGUI/Shop/PayDriver/ITransact.pm b/lib/WebGUI/Shop/PayDriver/ITransact.pm index 6d3805183..c573dfc3f 100644 --- a/lib/WebGUI/Shop/PayDriver/ITransact.pm +++ b/lib/WebGUI/Shop/PayDriver/ITransact.pm @@ -97,13 +97,13 @@ sub _generatePaymentRequestXML { $recurringData->{ RecurRecipe } = $self->_resolveRecurRecipe( $sku->getRecurInterval ); $recurringData->{ RecurReps } = 99999; $recurringData->{ RecurTotal } = - $item->get('price') + $transaction->get('taxes') + $transaction->get('shippingPrice'); + sprintf("%.2f",$item->get('price') + $transaction->get('taxes') + $transaction->get('shippingPrice')); $recurringData->{ RecurDesc } = $item->get('configuredTitle'); } # else { push @{ $orderItems->{ Item } }, { Description => $item->get('configuredTitle'), - Cost => $item->get('price'), + Cost => sprintf("%.2f", $item->get('price')), Qty => $item->get('quantity'), } # } @@ -114,21 +114,21 @@ sub _generatePaymentRequestXML { if ( $transaction->get('taxes') > 0 ) { push @{ $orderItems->{ Item } }, { Description => $i18n->get('taxes'), - Cost => $transaction->get('taxes'), + Cost => sprintf("%.2f",$transaction->get('taxes')), Qty => 1, }; } if ($transaction->get('shippingPrice') > 0) { push @{ $orderItems->{ Item } }, { Description => $i18n->get('shipping'), - Cost => $transaction->get('shippingPrice'), + Cost => sprintf("%.2f",$transaction->get('shippingPrice')), Qty => 1, }; } if ($transaction->get('shopCreditDeduction') < 0) { push @{ $orderItems->{ Item } }, { Description => $i18n->get('in shop credit'), - Cost => $transaction->get('shopCreditDeduction'), + Cost => sprintf("%.2f",$transaction->get('shopCreditDeduction')), Qty => 1, }; }