Author: lektran
Date: Mon May 18 11:38:06 2009
New Revision: 775902
URL:
http://svn.apache.org/viewvc?rev=775902&view=revLog:
Made the PayPal parameter cancelReturnUrl (cancel_return) optional
Changed the IPN handler to use the system userLoginId rather than admin
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java?rev=775902&r1=775901&r2=775902&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java Mon May 18 11:38:06 2009
@@ -137,7 +137,6 @@
if (UtilValidate.isEmpty(redirectUrl)
|| UtilValidate.isEmpty(notifyUrl)
|| UtilValidate.isEmpty(returnUrl)
- || UtilValidate.isEmpty(cancelReturnUrl)
|| UtilValidate.isEmpty(imageUrl)
|| UtilValidate.isEmpty(payPalAccount) ) {
Debug.logError("Payment properties is not configured properly, some notify URL from PayPal is not correctly defined!", module);
@@ -155,7 +154,7 @@
parameters.put("custom", userLogin.getString("userLoginId"));
parameters.put("amount", orderTotal);
parameters.put("return", returnUrl);
- parameters.put("cancel_return", cancelReturnUrl);
+ if (UtilValidate.isNotEmpty(cancelReturnUrl)) parameters.put("cancel_return", cancelReturnUrl);
parameters.put("notify_url", notifyUrl);
parameters.put("image_url", imageUrl);
parameters.put("no_note", "1"); // no notes allowed in paypal (not passed back)
@@ -265,7 +264,7 @@
GenericValue userLogin = null;
String userLoginId = request.getParameter("custom");
if (userLoginId == null)
- userLoginId = "admin";
+ userLoginId = "system";
try {
userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId));
} catch (GenericEntityException e) {