/** * @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; }
/** * set the account data to given payment * * @param Mage_Sales_Model_Quote_Payment $payment * @param array $params */ protected function setAccountData(Mage_Sales_Model_Quote_Payment $payment, array $params) { $country = $this->getCountry($params); if ('DE' == $country || 'AT' == $country) { if ($this->hasIban($params) && 'DE' == $country) { $payment->setAdditionalInformation('CARDNO', trim($params['iban'])); } else { $payment->setAdditionalInformation('CARDNO', trim($params['account']) . 'BLZ' . trim($params['bankcode'])); } } if ('NL' == $country) { if ($this->hasIban($params)) { $payment->setAdditionalInformation('CARDNO', trim($params['iban'])); $payment->setAdditionalInformation('BIC', trim($params['bic'])); } else { $payment->setAdditionalInformation('CARDNO', str_pad($params['account'], '0', STR_PAD_LEFT)); } } }