[ 
https://issues.apache.org/jira/browse/OFBIZ-5927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14257641#comment-14257641
 ] 

Scott Gray commented on OFBIZ-5927:
-----------------------------------

Sorry if my comment was unclear, here is what I am saying should be done:
{code}
Index: 
applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
===================================================================
--- 
applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
 (revision 1647466)
+++ 
applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
 (working copy)
@@ -253,7 +253,7 @@
             return reply;
         }
         Map<String, Object> results = ServiceUtil.returnSuccess();
-        context.put("x_Amount", context.get("releaseAmount")); // hack for 
releaseAmount
+        context.put("x_Amount", ((BigDecimal) 
context.get("releaseAmount")).toPlainString()); // hack for releaseAmount
         results.putAll(processReleaseTransResult(context, reply));
         return results;
     }
@@ -824,8 +824,8 @@
     private static BigDecimal getXAmount(Map<String, Object> request) {
         BigDecimal amt = BigDecimal.ZERO;
         if (request.get("x_Amount") != null) {
-            BigDecimal amount = (BigDecimal) request.get("x_Amount");
             try {
+                BigDecimal amount = new BigDecimal((String) 
request.get("x_Amount"));
                 amt = amount;
             } catch (NumberFormatException e) {
                 Debug.logWarning(e, e.getMessage(), module);
{code}

The change in the first hunk is important otherwise we're fixing one issue but 
creating another.  

> Issue reported while performing Refund & Void (java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.math.BigDecimal)
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5927
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5927
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Prateek Ashtikar
>             Fix For: Upcoming Branch, 12.04.06, 13.07.02
>
>
> Issue reported while performing Refund & Void (java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.math.BigDecimal)
> Change needs to be done in AIMPaymentServices.java. Please look at the 
> following small patch:-
>  
> //BigDecimal amount = (BigDecimal) request.get("x_Amount");
> String newAmt = request.get("x_Amount").toString();
> BigDecimal amount = new BigDecimal(newAmt);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to