Bridge/Symfony/Action/GetPaymentMethodAction.php
protected function getMethodCode($model)
	{
		$keywords = array(
			'visa' => 'VISA',
			'atm' => 'ATM_ONLINE',
			'nl' => 'NL',
			'ví' => 'NL',
			'ttvp' => 'TTVP',
		);

		$paymentMethodName = $this->getPaymentMethodName($model);
		$info = array();
		foreach($keywords as $key => $paymentMethod)
		{
			if ( strpos(strtolower($paymentMethodName), $key) !== false  )
			{
				$info['payment_method'] = $paymentMethod;
				break;
			}	
		}
		
		if ( !isset($info['payment_method']) )
		{
			throw new \LogicException('No payment method supports.');
		}
		
		$info['payment_type'] = 1;
		
		return $info;
	}
protected function getMethodCode($model)
	{
		$keywords = array(
			'visa' => 'VISA',
			'atm' => 'ATM_ONLINE',
			'nl' => 'NL',
			'ví' => 'NL',
			'ttvp' => 'TTVP',
		);

		$paymentMethodName = $this->getPaymentMethodName($model);
		$info = array();
		foreach($keywords as $key => $paymentMethod)
		{
			if ( strpos(strtolower($paymentMethodName), $key) !== false  )
			{
				$info['payment_method'] = $paymentMethod;
				break;
			}	
		}
		
		if ( !isset($info['payment_method']) )
		{
			throw new \LogicException('No payment method supports.');
		}
		
		$info['payment_type'] = 1;
		
		return $info;
	}
protected function getMethodCode ( $ model ) { $ keywords = array ( 'visa' => 'VISA' , 'atm' => 'ATM_ONLINE' , 'nl' => 'NL' , 'ví'  >  NL', 'ttvp' => 'TTVP' , ) ; $ paymentMethodName = $ this -> getPaymentMethodName ( $ model ) ; $ info = array ( ) ; foreach ( $ keywords as $ key => $ paymentMethod ) { if ( strpos ( strtolower ( $ paymentMethodName ) , $ key ) !== false ) { $ info [ 'payment_method' ] = $ paymentMethod ; break ; } } if ( ! isset ( $ info [ 'payment_method' ] ) ) { throw new \ LogicException ( 'No payment method supports.' ) ; } $ info [ 'payment_type' ] = 1 ; return $ info ; }
Gets payment method code from method name

@param object $model

@return array
Gets payment method code from method name