public function processAuthorization(oxOrder $oOrder, stdClass $oAuthorizationDetails)
    {
        $oAuthorizationStatus = $oAuthorizationDetails->AuthorizationStatus;

        //Update Order with primary response info
        $oOrder->assign(array('oxtransstatus' => 'AMZ-Authorize-'.$oAuthorizationStatus->State));
        $oOrder->save();

        // Handle Declined response
        if ($oAuthorizationStatus->State === 'Declined'
            && $this->getConfig()->getConfigParam('sAmazonMode') === bestitAmazonPay4OxidClient::OPTIMIZED_FLOW
        ) {
            switch ($oAuthorizationStatus->ReasonCode) {
                case "InvalidPaymentMethod":
                    /** @var bestitAmazonPay4Oxid_oxEmail $oEmail */
                    $oEmail = $this->getObjectFactory()->createOxidObject('oxEmail');
                    $oEmail->sendAmazonInvalidPaymentEmail($oOrder);
                    break;
                case "AmazonRejected":
                    /** @var bestitAmazonPay4Oxid_oxEmail $oEmail */
                    $oEmail = $this->getObjectFactory()->createOxidObject('oxEmail');
                    $oEmail->sendAmazonRejectedPaymentEmail($oOrder);
                    $this->closeOrderReference($oOrder, array(), false);
                    break;
                default:
                    $this->closeOrderReference($oOrder, array(), false);
            }
        }

        //Authorize handling was selected Direct Capture after Authorize and Authorization status is Open
        if ($oAuthorizationStatus->State === 'Open'
            && $this->getConfig()->getConfigParam('sAmazonCapture') === 'DIRECT'
        ) {
            $this->capture($oOrder);
        }
    }