/** * @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; }
/** * @param Adyen_Payment_Model_Billing_Agreement $billingAgreement * @param Mage_Sales_Model_Quote_Payment $paymentInfo * * @return $this */ public function initBillingAgreementPaymentInfo(Adyen_Payment_Model_Billing_Agreement $billingAgreement, Mage_Sales_Model_Quote_Payment $paymentInfo) { try { $recurringDetailReference = $billingAgreement->getReferenceId(); $paymentInfo->setMethod('adyen_oneclick_' . $recurringDetailReference); $paymentInfo->setAdditionalInformation('recurring_detail_reference', $recurringDetailReference); // set the ccType needed for Sepa, Sofort and Ideal $agreementData = $billingAgreement->getAgreementData(); if (isset($agreementData['variant'])) { $paymentInfo->setCcType($agreementData['variant']); } } catch (Exception $e) { Adyen_Payment_Exception::logException($e); } return $this; }