Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-4662

Order: Error in payment authorization

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce

      1. Enable error reporting
      2. Create a CC account on a client
      3. Start an order and move to checkout
      4. Try to pay with the cc account
      5. View the error log file
      6. See the following error

        [2022-05-27T17:09:30.609300+00:00] general.ERROR: UnknownException: Trying to get property 'status' of non-object in F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php:892 Stack trace: #0 F:\wamp\www\blesta-5.0\public_html\vendors\monolog\monolog\src\Monolog\ErrorHandler.php(200): UnknownException::setErrorHandler(8, 'Trying to get p...', 'F:\\wamp\\www
        ble...', 892, Array) #1 F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php(892): Monolog\ErrorHandler->handleError(8, 'Trying to get p...', 'F:\\wamp\\www
        ble...', 892, Array) #2 F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php(789): Checkout->authorizePayment(Array, Array, '2.0300') #3 F:\wamp\www\blesta-5.0\public_html\vendors\minphp\bridge\src\Lib\Dispatcher.php(142): Checkout->getPaymentConfirmation() #4 F:\wamp\www\blesta-5.0\public_html\index.php(21): Dispatcher::dispatch('/blesta-5.0/pub...') #5 {main}

      To resolve change plugins/order/controller/checkout.php around line 889:

                  if ($gateway_obj instanceof MerchantAchVerification && !empty($account_id)) {
                      $account = $this->Accounts->getAch($account_id);
      
                      if ($account->status == 'unverified') {
                          $response['redirect'] = $this->client_uri . 'accounts/verifyach/' . $account_id . '/';
      
                          return $response;
                      }
                  }
      

      To

                  if ($type == 'ach'
                      && $gateway_obj instanceof MerchantAchVerification
                      && !empty($account_id)
                      && ($account = $this->Accounts->getAch($account_id))
                      && $account->status == 'unverified'
                  ) {
                      $response['redirect'] = $this->client_uri . 'accounts/verifyach/' . $account_id . '/';
      
                      return $response;
                  }
      

        Activity

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Description To reproduce
        # Enable error reporting
        # Create a CC account on a client
        # Start an order and move to checkout
        # Try to pay with the cc account
        # View the error log file
        # See the following error
        {quote}
        \[2022-05-27T17:09:30.609300+00:00\] general.ERROR: UnknownException: Trying to get property 'status' of non-object in F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php:892 Stack trace: #0 F:\wamp\www\blesta-5.0\public_html\vendors\monolog\monolog\src\Monolog\ErrorHandler.php(200): UnknownException::setErrorHandler(8, 'Trying to get p...', 'F:\\wamp\\www\\ble...', 892, Array) #1 F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php(892): Monolog\ErrorHandler->handleError(8, 'Trying to get p...', 'F:\\wamp\\www\\ble...', 892, Array) #2 F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php(789): Checkout->authorizePayment(Array, Array, '2.0300') #3 F:\wamp\www\blesta-5.0\public_html\vendors\minphp\bridge\src\Lib\Dispatcher.php(142): Checkout->getPaymentConfirmation() #4 F:\wamp\www\blesta-5.0\public_html\index.php(21): Dispatcher::dispatch('/blesta-5.0/pub...') #5 \{main\}
        {quote}

        To resolve change plugins/order/controller/checkout.php around line 889:

        {code:java}
                    if ($gateway_obj instanceof MerchantAchVerification && !empty($account_id)) {
                        $account = $this->Accounts->getAch($account_id);

                        if ($account->status == 'unverified') {
                            $response['redirect'] = $this->client_uri . 'accounts/verifyach/' . $account_id . '/';

                            return $response;
                        }
                    }
        {code}

        To

        {code:java}
                    if ($gateway_obj instanceof MerchantAchVerification
                        && !empty($account_id)
                        && ($account = $this->Accounts->getAch($account_id))
                        && $account->status == 'unverified'
                    ) {
                        $response['redirect'] = $this->client_uri . 'accounts/verifyach/' . $account_id . '/';

                        return $response;
                    }
        {code}
        To reproduce
        # Enable error reporting
        # Create a CC account on a client
        # Start an order and move to checkout
        # Try to pay with the cc account
        # View the error log file
        # See the following error
        {quote}
        \[2022-05-27T17:09:30.609300+00:00\] general.ERROR: UnknownException: Trying to get property 'status' of non-object in F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php:892 Stack trace: #0 F:\wamp\www\blesta-5.0\public_html\vendors\monolog\monolog\src\Monolog\ErrorHandler.php(200): UnknownException::setErrorHandler(8, 'Trying to get p...', 'F:\\wamp\\www\\ble...', 892, Array) #1 F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php(892): Monolog\ErrorHandler->handleError(8, 'Trying to get p...', 'F:\\wamp\\www\\ble...', 892, Array) #2 F:\wamp\www\blesta-5.0\public_html\plugins\order\controllers\checkout.php(789): Checkout->authorizePayment(Array, Array, '2.0300') #3 F:\wamp\www\blesta-5.0\public_html\vendors\minphp\bridge\src\Lib\Dispatcher.php(142): Checkout->getPaymentConfirmation() #4 F:\wamp\www\blesta-5.0\public_html\index.php(21): Dispatcher::dispatch('/blesta-5.0/pub...') #5 \{main\}
        {quote}

        To resolve change plugins/order/controller/checkout.php around line 889:

        {code:java}
                    if ($gateway_obj instanceof MerchantAchVerification && !empty($account_id)) {
                        $account = $this->Accounts->getAch($account_id);

                        if ($account->status == 'unverified') {
                            $response['redirect'] = $this->client_uri . 'accounts/verifyach/' . $account_id . '/';

                            return $response;
                        }
                    }
        {code}

        To

        {code:java}
                    if ($type == 'ach'
                        && $gateway_obj instanceof MerchantAchVerification
                        && !empty($account_id)
                        && ($account = $this->Accounts->getAch($account_id))
                        && $account->status == 'unverified'
                    ) {
                        $response['redirect'] = $this->client_uri . 'accounts/verifyach/' . $account_id . '/';

                        return $response;
                    }
        {code}
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.5.0 Sprint 4 [ 157 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked lower
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.5.0 Sprint 4 [ 157 ] 5.5.0 Sprint 4, 5.5.0 Sprint 5 [ 157, 159 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Assignee Jonathan Reissmueller [ jonathan ]
        jonathan Jonathan Reissmueller made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        jonathan Jonathan Reissmueller made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 15 minutes [ 900 ]
        Worklog Id 15758 [ 15758 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        abdy Abdy Franco made changes -
        Time Spent 15 minutes [ 900 ] 22 minutes [ 1320 ]
        Worklog Id 15764 [ 15764 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              29/Jun/22

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 22 minutes
              22m

                Agile