svn commit: r796051 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java

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

svn commit: r796051 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java

lektran
Author: lektran
Date: Mon Jul 20 22:57:51 2009
New Revision: 796051

URL: http://svn.apache.org/viewvc?rev=796051&view=rev
Log:
Prevent checkExternalPayment from returning paypal when using express checkout

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=796051&r1=796050&r2=796051&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Mon Jul 20 22:57:51 2009
@@ -1264,10 +1264,13 @@
                 GenericValue paymentPreference = EntityUtil.getFirst(paymentPrefs);
                 String paymentMethodTypeId = paymentPreference.getString("paymentMethodTypeId");
                 if (paymentMethodTypeId.startsWith("EXT_")) {
-                    String type = paymentMethodTypeId.substring(4);
-                    result = ServiceUtil.returnSuccess();
-                    result.put("type", type.toLowerCase());
-                    return result;
+                    // PayPal with a PaymentMethod is not an external payment method
+                    if (!(paymentMethodTypeId.equals("EXT_PAYPAL") && UtilValidate.isNotEmpty(paymentPreference.getString("paymentMethodId")))) {
+                        String type = paymentMethodTypeId.substring(4);
+                        result = ServiceUtil.returnSuccess();
+                        result.put("type", type.toLowerCase());
+                        return result;
+                    }
                 }
             }
             result = ServiceUtil.returnSuccess();