svn commit: r604632 - in /ofbiz/trunk/applications/accounting: config/payment.properties src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java

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

svn commit: r604632 - in /ofbiz/trunk/applications/accounting: config/payment.properties src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java

mrisaliti
Author: mrisaliti
Date: Sun Dec 16 07:04:49 2007
New Revision: 604632

URL: http://svn.apache.org/viewvc?rev=604632&view=rev
Log:
As suggested in dev mailing list I have left empty the notify urls from PayPal to OFBiz and return an error in case they are not configurated correctly.

Modified:
    ofbiz/trunk/applications/accounting/config/payment.properties
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java

Modified: ofbiz/trunk/applications/accounting/config/payment.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/payment.properties?rev=604632&r1=604631&r2=604632&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/payment.properties (original)
+++ ofbiz/trunk/applications/accounting/config/payment.properties Sun Dec 16 07:04:49 2007
@@ -242,13 +242,13 @@
 payment.paypal.business=[hidden email]
 
 # PayPal Notify URL
-payment.paypal.notify=http://demo.hotwaxmedia.com/ecommerce/control/payPalNotify
+payment.paypal.notify=
 
 # PayPal Return URL
-payment.paypal.return=http://demo.hotwaxmedia.com/ecommerce/control/orderhistory
+payment.paypal.return=
 
 # PayPal Return On Cancel URL
-payment.paypal.cancelReturn=http://demo.hotwaxmedia.com/ecommerce/control/payPalCancel/main
+payment.paypal.cancelReturn=
 
 # Image To Use On PayPal
 payment.paypal.image=http://demo.hotwaxmedia.com/images/ofbiz_logo.jpg

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=604632&r1=604631&r2=604632&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 Sun Dec 16 07:04:49 2007
@@ -128,7 +128,13 @@
         
         // get the paypal account
         String payPalAccount = UtilProperties.getPropertyValue(configString, "payment.paypal.business");
-                
+        
+        if (UtilValidate.isEmpty(notifyUrl) || UtilValidate.isEmpty(returnUrl) || UtilValidate.isEmpty(cancelReturnUrl)) {
+            Debug.logError("Payment properties is not configured properly, some notify URL from PayPal is not correctly defined!", module);
+            request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource, "payPalEvents.problemsGettingMerchantConfiguration", locale));
+            return "error";
+        }
+        
         // create the redirect string
         Map <String, Object> parameters = new LinkedHashMap <String, Object>();
         parameters.put("cmd", "_xclick");