diff --git a/applications/accounting/servicedef/services_paypal.xml b/applications/accounting/servicedef/services_paypal.xml
index 1ffcd944dd..ef4c323270 100644
--- a/applications/accounting/servicedef/services_paypal.xml
+++ b/applications/accounting/servicedef/services_paypal.xml
@@ -34,6 +34,11 @@ under the License.
location="org.ofbiz.accounting.thirdparty.paypal.PayPalServices" invoke="doExpressCheckout">
+
+
+
+
diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
index 0b4413b6af..995fa6eb8b 100644
--- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
+++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
@@ -120,7 +120,7 @@ public class PayPalServices {
encoder.add("L_SHIPPINGOPTIONISDEFAULT0", "true");
encoder.add("L_SHIPPINGOPTIONNAME0", "NO_SHIPPING@_NA_");
//TODO: This isn't working
- encoder.add("L_SHIPPINGOPTIONLABEL0", "Calculated Offline");
+ encoder.add("L_SHIPINGPOPTIONLABEL0", "Calculated Offline");
encoder.add("L_SHIPPINGOPTIONAMOUNT0", "0.00");
}
encoder.add("ALLOWNOTE", "1");
@@ -161,21 +161,21 @@ public class PayPalServices {
return ServiceUtil.returnSuccess();
}
- public Map payPalExpressCheckoutUpdate(DispatchContext dctx, Map context) {
+ public static Map payPalCheckoutUpdate(DispatchContext dctx, Map context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericDelegator delegator = dctx.getDelegator();
HttpServletRequest request = (HttpServletRequest) context.get("request");
HttpServletResponse response = (HttpServletResponse) context.get("response");
- String remoteHost = request.getRemoteHost();
- if (!remoteHost.endsWith(".paypal.com")) {
- try {
- response.sendError(HttpServletResponse.SC_FORBIDDEN);
- Debug.logError("An Express Checkout Update request was received from a host other than *.paypal.com, responded with 403 Forbidden", module);
- } catch (IOException e) {
- Debug.logError(e, module);
- }
- return ServiceUtil.returnSuccess();
- }
+// String remoteHost = request.getRemoteHost();
+// if (!remoteHost.endsWith(".paypal.com")) {
+// try {
+// response.sendError(HttpServletResponse.SC_FORBIDDEN);
+// Debug.logError("An Express Checkout Update request was received from a host other than *.paypal.com, responded with 403 Forbidden", module);
+// } catch (IOException e) {
+// Debug.logError(e, module);
+// }
+// return ServiceUtil.returnSuccess();
+// }
String requestMessage = null;
try {
@@ -331,11 +331,11 @@ public class PayPalServices {
line++;
}
encoder.add("ITEMAMT", cart.getSubTotal().add(otherAdjustments).setScale(2).toPlainString());
- encoder.add("SHIPPINGAMT", "1.00");
+ encoder.add("SHIPPINGAMT", "0.00");
encoder.add("TAXAMT", "0.00");
- encoder.add("AMT", cart.getSubTotal().add(otherAdjustments).add(BigDecimal.ONE).setScale(2).toPlainString());
+ encoder.add("AMT", cart.getSubTotal().add(otherAdjustments).setScale(2).toPlainString());
//NOTE: The docs say this is optional but then won't work without it
- encoder.add("MAXAMT", cart.getSubTotal().add(otherAdjustments).add(BigDecimal.ONE).setScale(2).toPlainString());
+ encoder.add("MAXAMT", cart.getSubTotal().add(otherAdjustments).setScale(2).toPlainString());
}
public static Map getExpressCheckout(DispatchContext dctx, Map context) {
diff --git a/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java b/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java
index bd0063cdb0..1f72a0df08 100644
--- a/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java
+++ b/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java
@@ -99,6 +99,22 @@ public class ExpressCheckoutEvents {
return "success";
}
+ public static String expressCheckoutUpdate(HttpServletRequest request, HttpServletResponse response) {
+ LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
+ CheckoutType checkoutType = determineCheckoutType(request);
+ if (checkoutType.equals(CheckoutType.STANDARD)) {
+ Map inMap = FastMap.newInstance();
+ inMap.put("request", request);
+ inMap.put("response", response);
+ try {
+ dispatcher.runSync("payPalCheckoutUpdate", inMap);
+ } catch (GenericServiceException e) {
+ Debug.logError(e, module);
+ }
+ }
+ return "success";
+ }
+
public static String getExpressCheckoutDetails(HttpServletRequest request, HttpServletResponse response) {
Locale locale = UtilHttp.getLocale(request);
LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
diff --git a/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml b/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
index ab54c19da7..ee1c41cfb9 100644
--- a/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
+++ b/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
@@ -810,8 +810,8 @@ under the License.
Handles callbacks from PayPal's Express Checkout Instant Update API
-
-
+
+