/** * Load available billing agreement methods * * @return array */ protected function _loadPaymentMethods() { if (!$this->_paymentMethods) { foreach ($this->_helper->getBillingAgreementMethods() as $paymentMethod) { $this->_paymentMethods[$paymentMethod->getCode()] = $paymentMethod->getTitle(); } } return $this->_paymentMethods; }
/** * Retrieve wizard payment options array * * @return array */ public function getWizardPaymentMethodOptions() { $paymentMethodOptions = []; foreach ($this->_helper->getBillingAgreementMethods() as $paymentMethod) { if ($paymentMethod->getConfigData('allow_billing_agreement_wizard') == 1) { $paymentMethodOptions[$paymentMethod->getCode()] = $paymentMethod->getTitle(); } } return $paymentMethodOptions; }
/** * @dataProvider getBillingAgreementMethodsDataProvider * @param $store * @param $quote * @param $paymentMethods * @param $expectedResult */ public function testGetBillingAgreementMethods($store, $quote, $paymentMethods, $expectedResult) { $this->_paymentDataMock->expects($this->any())->method('getStoreMethods')->with($store, $quote)->will($this->returnValue($paymentMethods)); $this->assertEquals($expectedResult, $this->_helper->getBillingAgreementMethods($store, $quote)); }