svn commit: r1296567 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1296567 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java

lektran
Author: lektran
Date: Sat Mar  3 02:55:25 2012
New Revision: 1296567

URL: http://svn.apache.org/viewvc?rev=1296567&view=rev
Log:
Fix some incorrect BigDecimal comparisons

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java?rev=1296567&r1=1296566&r2=1296567&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java Sat Mar  3 02:55:25 2012
@@ -651,7 +651,7 @@ public class AIMPaymentServices {
             results.put("authRefNum", ar.getTransactionId());
             results.put("cvCode", ar.getCvResult());
             results.put("avsCode", ar.getAvsResult());
-            if (ar.getAmount() == BigDecimal.ZERO) {
+            if (BigDecimal.ZERO.compareTo(ar.getAmount()) == 0) {
                 results.put("processAmount", getXAmount(request));
             } else {
                 results.put("processAmount", ar.getAmount());
@@ -673,7 +673,7 @@ public class AIMPaymentServices {
         results.put("captureRefNum", ar.getTransactionId());
         if (captureResult.booleanValue()) { //passed
             results.put("captureCode", ar.getAuthorizationCode());
-            if (ar.getAmount() == BigDecimal.ZERO) {
+            if (BigDecimal.ZERO.compareTo(ar.getAmount()) == 0) {
                 results.put("captureAmount", getXAmount(request));
             } else {
                 results.put("captureAmount", ar.getAmount());
@@ -694,7 +694,7 @@ public class AIMPaymentServices {
         results.put("refundRefNum", ar.getTransactionId());
         if (captureResult.booleanValue()) { //passed
             results.put("refundCode", ar.getAuthorizationCode());
-            if (ar.getAmount() == BigDecimal.ZERO) {
+            if (BigDecimal.ZERO.compareTo(ar.getAmount()) == 0) {
                 results.put("refundAmount", getXAmount(request));
             } else {
                 results.put("refundAmount", ar.getAmount());
@@ -716,7 +716,7 @@ public class AIMPaymentServices {
         results.put("releaseRefNum", ar.getTransactionId());
         if (captureResult.booleanValue()) { //passed
             results.put("releaseCode", ar.getAuthorizationCode());
-            if (ar.getAmount() == BigDecimal.ZERO) {
+            if (BigDecimal.ZERO.compareTo(ar.getAmount()) == 0) {
                 results.put("releaseAmount", getXAmount(request));
             } else {
                 results.put("releaseAmount", ar.getAmount());
@@ -743,7 +743,7 @@ public class AIMPaymentServices {
             results.put("authRefNum", ar.getTransactionId());
             results.put("cvCode", ar.getCvResult());
             results.put("avsCode", ar.getAvsResult());
-            if (ar.getAmount() == BigDecimal.ZERO) {
+            if (BigDecimal.ZERO.compareTo(ar.getAmount()) == 0) {
                 results.put("processAmount", getXAmount(request));
             } else {
                 results.put("processAmount", ar.getAmount());