Author: jonesde
Date: Mon Sep 24 15:23:19 2007
New Revision: 578998

URL: http://svn.apache.org/viewvc?rev=578998&view=rev
Log:
Changed order of validation operations in send process shipment service to do 
auth check last because many orders won't need it, and an error in the auth 
check causes strange problems for that code right now

Modified:
    
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

Modified: 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?rev=578998&r1=578997&r2=578998&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java 
(original)
+++ 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java 
Mon Sep 24 15:23:19 2007
@@ -733,16 +733,6 @@
                 return ServiceUtil.returnSuccess(successMsg);
             }
             
-            // check payment authorization
-            Map authServiceContext = FastMap.newInstance();
-            authServiceContext.put("orderId", orderId);
-            authServiceContext.put("userLogin", userLogin);
-            authServiceContext.put("reAuth", new Boolean("true"));
-            Map authResult = dispatcher.runSync("authOrderPayments", 
authServiceContext);
-            if (!authResult.get("processResult").equals("APPROVED")) {
-                return ServiceUtil.returnError("No authorized payment 
available, not sending Process Shipment");            
-            }
-            
             orderHeader = delegator.findByPrimaryKey("OrderHeader", 
UtilMisc.toMap("orderId", orderId));
             if (orderHeader == null) {
                 return ServiceUtil.returnError("Could not find OrderHeader 
with ID [" + orderId + "]");
@@ -767,6 +757,16 @@
                 return ServiceUtil.returnError("Cannot send Process Shipment 
for order [" + orderId + "], it has no shipping address.");
             }
 
+            // check payment authorization
+            Map authServiceContext = FastMap.newInstance();
+            authServiceContext.put("orderId", orderId);
+            authServiceContext.put("userLogin", userLogin);
+            authServiceContext.put("reAuth", new Boolean("true"));
+            Map authResult = dispatcher.runSync("authOrderPayments", 
authServiceContext);
+            if (!authResult.get("processResult").equals("APPROVED")) {
+                return ServiceUtil.returnError("No authorized payment 
available, not sending Process Shipment");            
+            }
+            
             referenceId = delegator.getNextSeqId("OagisMessageInfo");
             omiPkMap = UtilMisc.toMap("logicalId", logicalId, "component", 
component, "task", task, "referenceId", referenceId);
 


Reply via email to