/** * {@inheritdoc} */ public function getConfig() { $config = []; /* * common config data */ foreach ($this->methodCodes as $code) { $config['payment'][$code]['instructions'] = $this->getInstructions($code); $config['payment'][$code]['displaymode'] = $this->methods[$code]->getDisplayMode(); $config['payment'][$code]['logo_url'] = $this->getLogoUrl($code); $config['payment'][$code]['back_url'] = $this->_dataHelper->getReturnUrl(); } /* * EPS financial institutions */ $fis = \WirecardCEE_QPay_PaymentType::getFinancialInstitutions(\WirecardCEE_QPay_PaymentType::EPS); $epsFinancialInstitutions = []; foreach ($fis as $k => $v) { $epsFinancialInstitutions[] = ['value' => $k, 'label' => html_entity_decode($v)]; } array_unshift($epsFinancialInstitutions, ['value' => '', 'label' => $this->_dataHelper->__('Choose your bank...')]); $config['payment'][Payment\Eps::CODE]['financialinstitutions'] = $epsFinancialInstitutions; /* * IDEAL financial institutions */ $fis = \WirecardCEE_QPay_PaymentType::getFinancialInstitutions(\WirecardCEE_QPay_PaymentType::IDL); $idealFinancialInstitutions = []; foreach ($fis as $k => $v) { $idealFinancialInstitutions[] = ['value' => $k, 'label' => htmlspecialchars_decode($v)]; } array_unshift($idealFinancialInstitutions, ['value' => '', 'label' => $this->_dataHelper->__('Choose your bank...')]); $config['payment'][Payment\Ideal::CODE]['financialinstitutions'] = $idealFinancialInstitutions; /* * Invoice/installment */ $config['payment'][Payment\Invoice::CODE]['provider'] = $this->methods[Payment\Invoice::CODE]->getProvider(); $config['payment'][Payment\Invoiceb2b::CODE]['provider'] = $this->methods[Payment\Invoiceb2b::CODE]->getProvider(); $config['payment'][Payment\Installment::CODE]['provider'] = $this->methods[Payment\Installment::CODE]->getProvider(); $txt = $this->_dataHelper->__('I agree that the data which are necessary for the liquidation of purchase on account and which are used to complete the identy and credit check are transmitted to payolution. My %s can be revoked at any time with effect for the future.'); $payolutionLink = $this->_dataHelper->getPayolutionLink($this->methods[Payment\Invoice::CODE]->getConfigData('payolution_mid')); if ($this->methods[Payment\Invoice::CODE]->getProvider() == 'payolution' && $this->methods[Payment\Invoice::CODE]->getConfigData('payolution_terms')) { $config['payment'][Payment\Invoice::CODE]['consenttxt'] = sprintf($txt, $payolutionLink); $config['payment'][Payment\Invoiceb2b::CODE]['consenttxt'] = sprintf($txt, $payolutionLink); } $config['payment'][Payment\Invoice::CODE]['min_age'] = (int) $this->methods[Payment\Invoice::CODE]->getConfigData('min_age'); $config['payment'][Payment\Installment::CODE]['min_age'] = (int) $this->methods[Payment\Installment::CODE]->getConfigData('min_age'); if ($this->methods[Payment\Invoice::CODE]->getProvider() == 'payolution') { $config['payment'][Payment\Invoice::CODE]['min_age'] = 18; } if ($this->methods[Payment\Installment::CODE]->getProvider() == 'payolution') { $config['payment'][Payment\Installment::CODE]['min_age'] = 18; } $payolutionLink = $this->_dataHelper->getPayolutionLink($this->methods[Payment\Installment::CODE]->getConfigData('payolution_mid')); if ($this->methods[Payment\Installment::CODE]->getProvider() == 'payolution' && $this->methods[Payment\Installment::CODE]->getConfigData('payolution_terms')) { $config['payment'][Payment\Installment::CODE]['consenttxt'] = sprintf($txt, $payolutionLink); } return $config; }
public function testGetEmptyFinancialInstitutions() { $paymentType = WirecardCEE_QPay_PaymentType::CCARD; $this->assertEmpty(WirecardCEE_QPay_PaymentType::getFinancialInstitutions($paymentType)); }