/** * @param Adyen_Payment_Model_Billing_Agreement $billingAgreement * @param Mage_Core_Model_Store $store * * @return bool */ protected function _createPaymentMethodFromBA(Adyen_Payment_Model_Billing_Agreement $billingAgreement, Mage_Core_Model_Store $store) { $methodInstance = $billingAgreement->getPaymentMethodInstance(); if (!$methodInstance || !$methodInstance->getConfigData('active', $store)) { return false; } $methodNewCode = 'adyen_oneclick_' . $billingAgreement->getReferenceId(); $methodData = array('model' => 'adyen/adyen_oneclick') + $billingAgreement->getOneClickData() + Mage::getStoreConfig('payment/adyen_oneclick', $store); foreach ($methodData as $key => $value) { $store->setConfig('payment/' . $methodNewCode . '/' . $key, $value); } return true; }