You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Kyra Pritzel-Hentley (JIRA)" <ji...@apache.org> on 2017/07/24 11:08:00 UTC

[jira] [Updated] (OFBIZ-9530) Missing action in empty if-statement in accounting.PaymentGatewayServices

     [ https://issues.apache.org/jira/browse/OFBIZ-9530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kyra Pritzel-Hentley updated OFBIZ-9530:
----------------------------------------
    Description: 
In the method _processAuthResult_ 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.

{code:java}
boolean authResultOk = authResult.booleanValue();
            
            if (authResultOk) {
                orderPaymentPreference.set("statusId", "PAYMENT_AUTHORIZED");
            } else {
                orderPaymentPreference.set("statusId", "PAYMENT_DECLINED");
            }
{code}

> Missing action in empty if-statement in accounting.PaymentGatewayServices
> -------------------------------------------------------------------------
>
>                 Key: OFBIZ-9530
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9530
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: Trunk
>            Reporter: Kyra Pritzel-Hentley
>            Priority: Minor
>
> In the method _processAuthResult_ 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.
> {code:java}
> boolean authResultOk = authResult.booleanValue();
>             
>             if (authResultOk) {
>                 orderPaymentPreference.set("statusId", "PAYMENT_AUTHORIZED");
>             } else {
>                 orderPaymentPreference.set("statusId", "PAYMENT_DECLINED");
>             }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)