svn commit: r885688 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java

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

svn commit: r885688 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java

ashish-18
Author: ashish
Date: Tue Dec  1 08:42:55 2009
New Revision: 885688

URL: http://svn.apache.org/viewvc?rev=885688&view=rev
Log:
Applied patch from jira issue OFBIZ-3278 - Improvement in Cybersource integration to better handle a sale transaction response.

For running the sale transaction that is auth+capture in a single transaction we set field autoBill to true in PaymentGatewayCyberSource entity or payment.cybersource.autoBill to true in payment.properties.

Improvement in code for Cybersource integration to handle better sale transaction response is needed. Sale transaction is used in Cybersource integration to provide payment authorization and capture together. Its already supported but improvement is needed so that transaction can be better entered in the system for further review for a specific order.

Thanks Pranay for the contribution.

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java?rev=885688&r1=885687&r2=885688&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java Tue Dec  1 08:42:55 2009
@@ -531,8 +531,17 @@
         result.put("cvCode", reply.get("ccAuthReply_cvCode"));
         result.put("avsCode", reply.get("ccAuthReply_avsCode"));
         result.put("scoreCode", reply.get("ccAuthReply_authFactorCode"));
-        result.put("captureRefNum", reply.get("requestID")); // maybe use something else here?
-        result.put("captureCode", reply.get("ccCaptureReply_reconciliationID"));
+        result.put("captureRefNum", reply.get("requestID"));
+        if (UtilValidate.isNotEmpty(reply.get("ccCaptureReply_reconciliationID"))) {
+            if ("ACCEPT".equalsIgnoreCase(decision)) {
+                result.put("captureResult", Boolean.TRUE);
+            } else {
+                result.put("captureResult", Boolean.FALSE);
+            }
+            result.put("captureCode", reply.get("ccCaptureReply_reconciliationID"));
+            result.put("captureFlag", reply.get("ccCaptureReply_reasonCode"));
+            result.put("captureMessage", reply.get("decision"));
+        }
         if (Debug.infoOn())
             Debug.logInfo("CC [Cybersource] authorization result : " + result, module);
     }