app/code/community/Adyen/Payment/Model/Adyen/Abstract.php
public function updateBillingAgreementStatus(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
    {
        Mage::dispatchEvent('adyen_payment_update_billing_agreement_status', array('agreement' => $agreement));

        $targetStatus = $agreement->getStatus();
        $adyenHelper = Mage::helper('adyen');

        if ($targetStatus == Mage_Sales_Model_Billing_Agreement::STATUS_CANCELED) {
            try {
                $this->_api()->disableRecurringContract(
                    $agreement->getReferenceId(),
                    $agreement->getCustomerReference(),
                    $agreement->getStoreId()
                );
            } catch (Adyen_Payment_Exception $e) {
                Mage::throwException(
                    $adyenHelper->__(
                        "Error while disabling Billing Agreement #%s: %s", $agreement->getReferenceId(),
                        $e->getMessage()
                    )
                );
            }
        } else {
            throw new Exception(
                Mage::helper('adyen')->__(
                    'Changing billing agreement status to "%s" not yet implemented.', $targetStatus
                )
            );
        }

        return $this;
    }
public function updateBillingAgreementStatus(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
    {
        Mage::dispatchEvent('adyen_payment_update_billing_agreement_status', array('agreement' => $agreement));

        $targetStatus = $agreement->getStatus();
        $adyenHelper = Mage::helper('adyen');

        if ($targetStatus == Mage_Sales_Model_Billing_Agreement::STATUS_CANCELED) {
            try {
                $this->_api()->disableRecurringContract(
                    $agreement->getReferenceId(),
                    $agreement->getCustomerReference(),
                    $agreement->getStoreId()
                );
            } catch (Adyen_Payment_Exception $e) {
                Mage::throwException(
                    $adyenHelper->__(
                        "Error while disabling Billing Agreement #%s: %s", $agreement->getReferenceId(),
                        $e->getMessage()
                    )
                );
            }
        } else {
            throw new Exception(
                Mage::helper('adyen')->__(
                    'Changing billing agreement status to "%s" not yet implemented.', $targetStatus
                )
            );
        }

        return $this;
    }
public function updateBillingAgreementStatus ( Mage_Payment_Model_Billing_AgreementAbstract $ agreement ) { Mage :: dispatchEvent ( 'adyen_payment_update_billing_agreement_status' , array ( 'agreement' => $ agreement ) ) ; $ targetStatus = $ agreement -> getStatus ( ) ; $ adyenHelper = Mage :: helper ( 'adyen' ) ; if ( $ targetStatus == Mage_Sales_Model_Billing_Agreement :: STATUS_CANCELED ) { try { $ this -> _api ( ) -> disableRecurringContract ( $ agreement -> getReferenceId ( ) , $ agreement -> getCustomerReference ( ) , $ agreement -> getStoreId ( ) ) ; } catch ( Adyen_Payment_Exception $ e ) { Mage :: throwException ( $ adyenHelper -> __ ( "Error while disabling Billing Agreement #%s: %s" , $ agreement -> getReferenceId ( ) , $ e -> getMessage ( ) ) ) ; } } else { throw new Exception ( Mage :: helper ( 'adyen' ) -> __ ( 'Changing billing agreement status to "%s" not yet implemented.' , $ targetStatus ) ) ; } return $ this ; }
Update billing agreement status

@param Adyen_Payment_Model_Billing_Agreement|Mage_Payment_Model_Billing_AgreementAbstract $agreement

@return $this
@throws Exception
@throws Mage_Core_Exception
Update billing agreement status