application/controllers/admin/bestitamazonpay4oxid_main.php
public function refundAmazonOrder()
    {
        $oConfig = $this->_getContainer()->getConfig();
        $sId = $this->getEditObjectId();

        if ((int)$sId !== -1
            && $sId !== null
            && (int)$oConfig->getRequestParameter('blAmazonConfirmRefund') === 1
        ) {
            /** @var oxOrder $oOrder */
            $oOrder = $this->_getContainer()->getObjectFactory()->createOxidObject('oxOrder');
            $oOrder->load($sId);
            $fAmazonRefundAmount = (float)str_replace(
                ',',
                '.',
                $oConfig->getRequestParameter('fAmazonRefundAmount')
            );

            if ($fAmazonRefundAmount > 0) {
                $this->_getContainer()->getClient()->refund($oOrder, $fAmazonRefundAmount);
            } else {
                $this->_aViewData['bestitrefunderror'] = $this->_getContainer()->getLanguage()
                    ->translateString('BESTITAMAZONPAY_INVALID_REFUND_AMOUNT');
            }
        } else {
            $this->_aViewData['bestitrefunderror'] = $this->_getContainer()->getLanguage()
                ->translateString('BESTITAMAZONPAY_PLEASE_CHECK_REFUND_CHECKBOX');
        }
    }
public function refundAmazonOrder()
    {
        $oConfig = $this->_getContainer()->getConfig();
        $sId = $this->getEditObjectId();

        if ((int)$sId !== -1
            && $sId !== null
            && (int)$oConfig->getRequestParameter('blAmazonConfirmRefund') === 1
        ) {
            /** @var oxOrder $oOrder */
            $oOrder = $this->_getContainer()->getObjectFactory()->createOxidObject('oxOrder');
            $oOrder->load($sId);
            $fAmazonRefundAmount = (float)str_replace(
                ',',
                '.',
                $oConfig->getRequestParameter('fAmazonRefundAmount')
            );

            if ($fAmazonRefundAmount > 0) {
                $this->_getContainer()->getClient()->refund($oOrder, $fAmazonRefundAmount);
            } else {
                $this->_aViewData['bestitrefunderror'] = $this->_getContainer()->getLanguage()
                    ->translateString('BESTITAMAZONPAY_INVALID_REFUND_AMOUNT');
            }
        } else {
            $this->_aViewData['bestitrefunderror'] = $this->_getContainer()->getLanguage()
                ->translateString('BESTITAMAZONPAY_PLEASE_CHECK_REFUND_CHECKBOX');
        }
    }
public function refundAmazonOrder ( ) { $ oConfig = $ this -> _getContainer ( ) -> getConfig ( ) ; $ sId = $ this -> getEditObjectId ( ) ; if ( ( int ) $ sId !== - 1 && $ sId !== null && ( int ) $ oConfig -> getRequestParameter ( 'blAmazonConfirmRefund' ) === 1 ) { /** @var oxOrder $oOrder */ $ oOrder = $ this -> _getContainer ( ) -> getObjectFactory ( ) -> createOxidObject ( 'oxOrder' ) ; $ oOrder -> load ( $ sId ) ; $ fAmazonRefundAmount = ( float ) str_replace ( ',' , '.' , $ oConfig -> getRequestParameter ( 'fAmazonRefundAmount' ) ) ; if ( $ fAmazonRefundAmount > 0 ) { $ this -> _getContainer ( ) -> getClient ( ) -> refund ( $ oOrder , $ fAmazonRefundAmount ) ; } else { $ this -> _aViewData [ 'bestitrefunderror' ] = $ this -> _getContainer ( ) -> getLanguage ( ) -> translateString ( 'BESTITAMAZONPAY_INVALID_REFUND_AMOUNT' ) ; } } else { $ this -> _aViewData [ 'bestitrefunderror' ] = $ this -> _getContainer ( ) -> getLanguage ( ) -> translateString ( 'BESTITAMAZONPAY_PLEASE_CHECK_REFUND_CHECKBOX' ) ; } }
Sends refund request to Amazon
@throws Exception
Sends refund request to Amazon