support rollback of shipping on failed credit card capture
----------------------------------------------------------

                 Key: OFBIZ-558
                 URL: http://issues.apache.org/jira/browse/OFBIZ-558
             Project: OFBiz (The Open for Business Project)
          Issue Type: Improvement
          Components: accounting
            Reporter: Si Chen


You might not realize this, but right now, if a credit card capture failed, 
ofbiz would allow the shipment to be created.  An invoice to be created but not 
paid.  This is legally correct of course and correct for b2b situations, but 
speaking with several b2c reatilers, this is not a desired behavior.

The solution is fairly simple:
1.  Add a field ProductStore.shipIfCaptureFails which can be set to Y or N
2.  In PaymentGatewayServices.captureOrderPayments at the very end, modify this 
block:
        if (amountToCapture > 0.00) {
            result.put(ModelService.RESPONSE_MESSAGE, 
ModelService.RESPOND_SUCCESS);
            result.put("processResult", "FAILED");
            return result;
        } else {

so that if (amountToCapture > 0.00) is true, then check the order's product 
store for shipIfCaptureFails, and if it is an "N", then instead of returning 
success with processResult = FAILED, just do a ServiceUtil.returnError("Cannot 
ship order because credit card captures were unsuccessful");


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

        

Reply via email to