You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ar...@apache.org on 2017/07/08 23:21:14 UTC

svn commit: r1801340 - /ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java

Author: arunpatidar
Date: Sat Jul  8 23:21:13 2017
New Revision: 1801340

URL: http://svn.apache.org/viewvc?rev=1801340&view=rev
Log:
Fixed:  Insufficient checking of checkOutPaymentId in CheckOutEvents.getSelectedPaymentMethods. (OFBIZ-9404)
Applied slightly modified  patch. Thanks Martin for your contribution.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java

Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1801340&r1=1801339&r2=1801340&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java Sat Jul  8 23:21:13 2017
@@ -289,6 +289,11 @@ public class CheckOutEvents {
         ShoppingCart cart = (ShoppingCart) request.getSession().getAttribute("shoppingCart");
         Map<String, Map<String, Object>> selectedPaymentMethods = new HashMap<String, Map<String, Object>>();
         String[] paymentMethods = request.getParameterValues("checkOutPaymentId");
+        
+        String checkOutPaymentId = (String) request.getAttribute("checkOutPaymentId");
+        if ((paymentMethods == null || paymentMethods.length <= 0) && UtilValidate.isNotEmpty(checkOutPaymentId)) {
+            paymentMethods = new String[] {checkOutPaymentId};
+        }
 
         if (UtilValidate.isNotEmpty(request.getParameter("issuerId"))) {
             request.setAttribute("issuerId", request.getParameter("issuerId"));