diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 7643e7f4e..9a46bc1b4 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -19,6 +19,8 @@ - fix: WG user not logged in Apache - Upgraded to TinyMCE 2.0.6.1, which fixes a number of bugs that WebGUI users have been experiencing with the Rich Editor. + - fix: Very very bad commerce bug that caused ITransact to charge the user more + than it was supposed to and more than it told them it was charging. 6.99.4 - fix: better checking of selected template type diff --git a/lib/WebGUI/Commerce/Payment/ITransact.pm b/lib/WebGUI/Commerce/Payment/ITransact.pm index e5e050a59..d30a8418a 100644 --- a/lib/WebGUI/Commerce/Payment/ITransact.pm +++ b/lib/WebGUI/Commerce/Payment/ITransact.pm @@ -478,7 +478,7 @@ my %transactionData = %{$self->{_transactionParams}}; ".$self->get('vendorId')." ".$self->get('password')." - ".$self->session->setting->get("companyURL").""; + ".$self->session->setting->get("companyURL")."\n"; if ($self->{_recurring}) { $xml .= @@ -487,7 +487,7 @@ my %transactionData = %{$self->{_transactionParams}}; $transactionData{TERM} $transactionData{AMT} $transactionData{DESCRIPTION} - "; + \n"; }; $xml .= @@ -505,10 +505,11 @@ my %transactionData = %{$self->{_transactionParams}}; # $data =~ s/>/>/sg; # $data =~ s/"/"/sg; $data =~ tr/A-Za-z0-9 //dc; + my $itemPrice = $_->{amount} / $_->{quantity}; $xml .= " ".$data." - ".sprintf('%.2f', $_->{amount})." + ".sprintf('%.2f', $itemPrice)." ".$_->{quantity}." \n"; } @@ -527,7 +528,15 @@ my %transactionData = %{$self->{_transactionParams}}; "; +## +## Nice for debugging +## +# open(DAT,">/tmp/itransact.xml") || die("Cannot Open File"); +# print DAT "$xml"; +# close(DAT); +# +$self->session->errorHandler->warn("
".$xml."
"); my $xmlTransactionScript = 'https://secure.paymentclearing.com/cgi-bin/rc/xmltrans.cgi'; # Set up LWP to post the XML to iTransact.