app/code/community/Adyen/Payment/Model/ProcessNotification.php
protected function _updateExistingBillingAgreementsStatus($customerReference, $recurringReferencesList)
    {
        $billingAgreements = Mage::getResourceModel('adyen/billing_agreement_collection')
            ->addFieldToFilter('customer_id', $customerReference);

        foreach ($billingAgreements as $billingAgreement) {
            if (!in_array($billingAgreement->getReferenceId(), $recurringReferencesList)) {
                $billingAgreement->setStatus(Adyen_Payment_Model_Billing_Agreement::STATUS_CANCELED);
            } else {
                $billingAgreement->setStatus(Adyen_Payment_Model_Billing_Agreement::STATUS_ACTIVE);
            }

            $billingAgreement->save();
        }
    }
protected function _updateExistingBillingAgreementsStatus($customerReference, $recurringReferencesList)
    {
        $billingAgreements = Mage::getResourceModel('adyen/billing_agreement_collection')
            ->addFieldToFilter('customer_id', $customerReference);

        foreach ($billingAgreements as $billingAgreement) {
            if (!in_array($billingAgreement->getReferenceId(), $recurringReferencesList)) {
                $billingAgreement->setStatus(Adyen_Payment_Model_Billing_Agreement::STATUS_CANCELED);
            } else {
                $billingAgreement->setStatus(Adyen_Payment_Model_Billing_Agreement::STATUS_ACTIVE);
            }

            $billingAgreement->save();
        }
    }
protected function _updateExistingBillingAgreementsStatus ( $ customerReference , $ recurringReferencesList ) { $ billingAgreements = Mage :: getResourceModel ( 'adyen/billing_agreement_collection' ) -> addFieldToFilter ( 'customer_id' , $ customerReference ) ; foreach ( $ billingAgreements as $ billingAgreement ) { if ( ! in_array ( $ billingAgreement -> getReferenceId ( ) , $ recurringReferencesList ) ) { $ billingAgreement -> setStatus ( Adyen_Payment_Model_Billing_Agreement :: STATUS_CANCELED ) ; } else { $ billingAgreement -> setStatus ( Adyen_Payment_Model_Billing_Agreement :: STATUS_ACTIVE ) ; } $ billingAgreement -> save ( ) ; } }
Update status of the agreements in Magento
Update status of the agreements in Magento