Author: jleroux
Date: Fri Aug 11 19:14:21 2017
New Revision: 1804843

URL: http://svn.apache.org/viewvc?rev=1804843&view=rev
Log:
Fixed: Missing action in empty if-statement in accounting.PaymentGatewayServices
(OFBIZ-9530)

In the method processAuthResult() line 1889 there is an empty if-statement for 
the case that authResult is null. It seems like somebody was planning to cover 
the case but forgot to add code.

I would suggest to return a service error when the authResult is null since 
otherwise it cannot be determined if the payment is authorized or not.


Thanks: Kyra Pritzel-Hentley

Modified:
    
ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingErrorUiLabels.xml
    
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java

Modified: 
ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingErrorUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingErrorUiLabels.xml?rev=1804843&r1=1804842&r2=1804843&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingErrorUiLabels.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingErrorUiLabels.xml
 Fri Aug 11 19:14:21 2017
@@ -773,6 +773,10 @@
     <property key="AccountingValidationFailedInvalidValues">
         <value xml:lang="en">Validation Failed - invalid values</value>
     </property>
+    <property key="AccountingProcessingAuthResultEmpty">
+        <value xml:lang="en">No authentification result available. Payment 
preference can't be checked.</value>
+        <value xml:lang="de">Es ist kein Authentifizierungsergebnis vorhanden. 
Die Zahlungsmethode kann nicht überprüft werden.</value>
+    </property>
     <property 
key="idealEvents.failedToExecuteServiceCreatePaymentFromPreference">
         <value xml:lang="ar">فشل في تنفيذ خدمة 
CreatePaymentFromPreference</value>
         <value xml:lang="de">Ausführen des Service 
CreatePaymentFromPreference fehlgeschlagen</value>

Modified: 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1804843&r1=1804842&r2=1804843&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
 Fri Aug 11 19:14:21 2017
@@ -1887,7 +1887,9 @@ public class PaymentGatewayServices {
         Locale locale = (Locale) context.get("locale");
         
         if(authResult == null) {
-            
+            Debug.logError("No authentification result available. Payment 
preference can't be checked.", module);
+            return ServiceUtil
+                    .returnError(UtilProperties.getMessage(resource, 
"AccountingProcessingAuthResultEmpty", locale));
         }
 
         // refresh the payment preference


Reply via email to