Author: jaz
Date: Thu May 17 09:59:56 2007
New Revision: 539012
URL:
http://svn.apache.org/viewvc?view=rev&rev=539012Log:
now handles the exception when an invalid paymentMethodId is set
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?view=diff&rev=539012&r1=539011&r2=539012==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu May 17 09:59:56 2007
@@ -19,7 +19,6 @@
package org.ofbiz.order.order;
import java.math.BigDecimal;
-import java.lang.Math;
import java.sql.Timestamp;
import java.text.NumberFormat;
import java.text.ParseException;
@@ -4066,7 +4065,11 @@
}
// set the payment method
- cart.addPayment(paymentMethodId);
+ try {
+ cart.addPayment(paymentMethodId);
+ } catch (IllegalArgumentException e) {
+ return ServiceUtil.returnError(e.getMessage());
+ }
// save the order (new tx)
Map createResp;