Author: surajk
Date: Sat Mar  9 05:22:19 2019
New Revision: 1855078

URL: http://svn.apache.org/viewvc?rev=1855078&view=rev
Log:
Fixed: Service failed to mark expired authorized payments of Authorize.net as 
void.
(OFBIZ-10727)
Thanks Amit Gadaley for reporting the issue and providing the patch, thanks 
Jacopo for discussion and feedback.

Modified:
    
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java

Modified: 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java?rev=1855078&r1=1855077&r2=1855078&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
 Sat Mar  9 05:22:19 2019
@@ -338,6 +338,12 @@ public class AIMPaymentServices {
             AuthorizeResponse ar = new AuthorizeResponse(httpResponse, 
apiType);            
             if (ar.isApproved()) {            
                 result.put("authResult", Boolean.TRUE);
+            }
+            //When the transaction is already expired in Authorize.net, then 
the response is an error message with reason code 16 (i.e. "The transaction 
cannot be found");
+            // in this case we proceed without generating an error in order to 
void/cancel the transaction record in OFBiz as well.
+            //This else if block takes care of the expired transaction.
+            else if ("VOID".equals(props.get("transType")) && 
"16".equals(ar.getReasonCode())) {
+                result.put("authResult", Boolean.TRUE);
             } else {
                 result.put("authResult", Boolean.FALSE);
                 if (Debug.infoOn()) {


Reply via email to