svn commit: r606043 - in /ofbiz/branches/release4.0/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: r606043 - in /ofbiz/branches/release4.0/applications/accounting: config/payment.properties src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java

jleroux@apache.org
Author: jleroux
Date: Thu Dec 20 14:36:18 2007
New Revision: 606043

URL: http://svn.apache.org/viewvc?rev=606043&view=rev
Log:
Merged by hand from trunk rev. 606031

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

Modified: ofbiz/branches/release4.0/applications/accounting/config/payment.properties
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/accounting/config/payment.properties?rev=606043&r1=606042&r2=606043&view=diff
==============================================================================
--- ofbiz/branches/release4.0/applications/accounting/config/payment.properties (original)
+++ ofbiz/branches/release4.0/applications/accounting/config/payment.properties Thu Dec 20 14:36:18 2007
@@ -236,32 +236,40 @@
 ############################################
 
 # PayPal E-Mail address
-payment.paypal.business=[hidden email]
+#payment.paypal.business=[hidden email]
+payment.paypal.business=
 
 # PayPal Notify URL
-payment.paypal.notify=http://[yourServerName]/ecommerce/control/payPalNotify
+#payment.paypal.notify=http://[yourServerName]/ecommerce/control/payPalNotify
+payment.paypal.notify=
 
 # PayPal Return URL
-payment.paypal.return=http://[yourServerName]/ecommerce/control/orderhistory
+#payment.paypal.return=http://[yourServerName]/ecommerce/control/orderhistory
+payment.paypal.return=
 
 # PayPal Return On Cancel URL
-payment.paypal.cancelReturn=http://[yourServerName]/ecommerce/control/payPalCancel/main
+#payment.paypal.cancelReturn=http://[yourServerName]/ecommerce/control/payPalCancel/main
+payment.paypal.cancelReturn=
 
 # Image To Use On PayPal
-payment.paypal.image=http://[yourServerName]/images/ofbiz_logo.jpg
+#payment.paypal.image=http://[yourServerName]/images/ofbiz_logo.jpg
+payment.paypal.image=
 
 # Thank-You / Confirm Order Template (rendered via Freemarker)
-payment.paypal.confirmTemplate=/order/emailconfirmation.ftl
+#payment.paypal.confirmTemplate=/order/emailconfirmation.ftl
+payment.paypal.confirmTemplate=
 
 # Production PayPal Redirect URL
 #payment.paypal.redirect=https://www.paypal.com/cgi-bin/webscr
 # Sandbox PayPal Redirect URL
-payment.paypal.redirect=https://www.sandbox.paypal.com/us/cgi-bin/webscr
+#payment.paypal.redirect=https://www.sandbox.paypal.com/us/cgi-bin/webscr
+payment.paypal.redirect=
 
 # Production PayPal Confirm URL (JSSE must be configured to use SSL)
 #payment.paypal.confirm=http://www.paypal.com/cgi-bin/webscr
 # Sandbox PayPal Confirm URL (JSSE must be configured to use SSL)
-payment.paypal.confirm=https://www.sandbox.paypal.com/us/cgi-bin/webscr
+#payment.paypal.confirm=https://www.sandbox.paypal.com/us/cgi-bin/webscr
+payment.paypal.confirm=
 
 ############################################
 # PCCharge Configuration

Modified: ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java?rev=606043&r1=606042&r2=606043&view=diff
==============================================================================
--- ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java (original)
+++ ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java Thu Dec 20 14:36:18 2007
@@ -127,7 +127,18 @@
         
         // get the paypal account
         String payPalAccount = UtilProperties.getPropertyValue(configString, "payment.paypal.business");
-                
+
+        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);
+                request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource, "payPalEvents.problemsGettingMerchantConfiguration", locale));
+                return "error";
+            }
+        
         // create the redirect string
         Map parameters = new LinkedMap();
         parameters.put("cmd", "_xclick");