[JIRA] Closed: (OFBIZ-19) Better handling of 0.00 total response from gateway implementations

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

[JIRA] Closed: (OFBIZ-19) Better handling of 0.00 total response from gateway implementations

JIRA jira@ofbiz.org
     [ http://jira.undersunconsulting.com/browse/OFBIZ-19?page=all ]
     
Jacopo Cappellato closed OFBIZ-19:
----------------------------------

    Resolution: Duplicate

https://issues.apache.org/jira/browse/OFBIZ-246

> Better handling of 0.00 total response from gateway implementations
> -------------------------------------------------------------------
>
>          Key: OFBIZ-19
>          URL: http://jira.undersunconsulting.com/browse/OFBIZ-19
>      Project: [OFBiz] Open For Business
>         Type: Improvement
>   Components: accounting
>     Versions: SVN
>     Reporter: Alexander Heiss
>     Assignee: Andrew Zeneski
>     Priority: Minor

>
>
> When we get back a 0.00 processAmount from an external payment implementation, setting the total to capture back to the max amount for the order is a bad idea; should at least change to get remaining total of payments left to be paid instead.
> ~line 1159 of PaymentGatewayServices change:
> amount = paymentPreference.getDouble("maxAmount");
> to
> double orderTotal = orh.getOrderGrandTotal();
> double totalPayments = PaymentWorker.getPaymentsTotal(orh.getOrderPayments());
> double remainingTotal = orderTotal - totalPayments;      
> amount =  new Double(remainingTotal);
> This assumes you want to always charge rest of order to this card.  Could also possibly check against the maxAmount to make sure we don't go over, but not too sure at the moment what to do if total left on order is over origional maxAmount, just cap it?

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.undersunconsulting.com/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira