Author: jacopoc
Date: Mon Sep 4 03:28:35 2006 New Revision: 440018 URL: http://svn.apache.org/viewvc?view=rev&rev=440018 Log: Now shoppingCart is an optional parameter of the "processOrderPayment" service (if not available, it is retrieved from the orderId). In this way the "processOrderPayment" service can be more easily triggered by eca. In fact it is now triggered by the cancelOrderItem service. Modified: incubator/ofbiz/trunk/applications/order/servicedef/secas.xml incubator/ofbiz/trunk/applications/order/servicedef/services.xml incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Modified: incubator/ofbiz/trunk/applications/order/servicedef/secas.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/secas.xml?view=diff&rev=440018&r1=440017&r2=440018 ============================================================================== --- incubator/ofbiz/trunk/applications/order/servicedef/secas.xml (original) +++ incubator/ofbiz/trunk/applications/order/servicedef/secas.xml Mon Sep 4 03:28:35 2006 @@ -99,11 +99,10 @@ <action service="recreateOrderAdjustments" mode="sync"/> <action service="resetGrandTotal" mode="sync"/> </eca> - <!-- <eca service="cancelOrderItem" event="return"> <action service="processOrderPayments" mode="sync"/> </eca> - --> + <!-- order confirmation/notification email ECAs --> <eca service="sendOrderConfirmation" event="commit"> <action service="createOrderNotificationLog" mode="sync"/> Modified: incubator/ofbiz/trunk/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services.xml?view=diff&rev=440018&r1=440017&r2=440018 ============================================================================== --- incubator/ofbiz/trunk/applications/order/servicedef/services.xml (original) +++ incubator/ofbiz/trunk/applications/order/servicedef/services.xml Mon Sep 4 03:28:35 2006 @@ -274,7 +274,7 @@ <service name="processOrderPayments" engine="java" auth="true" location="org.ofbiz.order.order.OrderServices" invoke="processOrderPayments"> <description>Process payments for an order</description> - <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/> + <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="true"/> <attribute name="orderId" type="String" mode="IN" optional="false"/> </service> Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?view=diff&rev=440018&r1=440017&r2=440018 ============================================================================== --- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Mon Sep 4 03:28:35 2006 @@ -3286,6 +3286,16 @@ OrderReadHelper orh = new OrderReadHelper(delegator, orderId); String productStoreId = orh.getProductStoreId(); + if (cart == null) { + try { + cart = loadCartForUpdate(dispatcher, delegator, userLogin, orderId); + } catch (GeneralException e) { + return ServiceUtil.returnError(e.getMessage()); + } + if (cart == null) { + return ServiceUtil.returnError("ERROR: Null shopping cart object returned!"); + } + } CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator, cart); // process the payments if (!"PURCHASE_ORDER".equals(cart.getOrderType())) { |
Free forum by Nabble | Edit this page |