[jira] [Commented] (OFBIZ-5927) Issue reported while performing Refund & Void (java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal)

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

[jira] [Commented] (OFBIZ-5927) Issue reported while performing Refund & Void (java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal)

Nicolas Malin (Jira)

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

Prateek Ashtikar commented on OFBIZ-5927:
-----------------------------------------

If this issue is tested successfully from your with your change then its great. The following line will be also worked.
BigDecimal amount = new BigDecimal((String) request.get("x_Amount"));

My suggested patch also working fine and its not causing any problem. I've done more than hundred's of transactions for Refund, Void, Auth etc., & don't see any issue on logs (no exception's etc..,). This was also a simple change.

I'll be modify my code for the following line
context.put("x_Amount", ((BigDecimal) context.get("releaseAmount")).toPlainString());

Many Thanks!

> 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)