public function entidadSelectAction()
 {
     $tarjeta = $this->getRequest()->get('tarjeta');
     $wsdls = $this->get_wsdls();
     $http_header = $this->get_http_header();
     $end_point = $this->get_end_point();
     require_once Mage::getBaseDir('lib') . '/metododepago2/TodoPago.php';
     $connector = new TodoPago($http_header, $wsdls, $end_point);
     $merchant = Mage::getStoreConfig('payment/todopago_modo/idstore');
     try {
         $pay_methods = $connector->getAllPaymentMethods(array('MERCHANT' => $merchant));
     } catch (Exception $e) {
         $exception['Operations']['Exception'] = $e;
         return $exception;
     }
     if (sizeof($pay_methods['PaymentMethod'][$tarjeta]['PromosCollection']) == 0) {
         echo "Cupón sin entidad Bancaria";
     } else {
         if (sizeof($pay_methods['PaymentMethod'][$tarjeta]['PromosCollection']['Promo']['BanksCollection']['Bank'][0]) == 0) {
             echo '<lable id="entidad_label">Entidad:</lable><br />';
             echo '<select id="bancos" name="payment[banco]">';
             echo '<option>' . $pay_methods['PaymentMethod'][$tarjeta]['PromosCollection']['Promo']['BanksCollection']['Bank']['Name'] . '</option>';
             echo "</select>";
         } else {
             $bancos = $pay_methods['PaymentMethod'][$tarjeta]['PromosCollection']['Promo']['BanksCollection']['Bank'];
             echo '<lable id="entidad_label">Entidad:</lable><br />';
             echo '<select id="bancos" name="payment[banco]">';
             foreach ($bancos as $value) {
                 echo '<option>' . $value['Name'] . '</option>';
             }
             echo "</select>";
         }
     }
 }
 public function get_pay_methods()
 {
     $wsdls = $this->get_wsdls();
     $http_header = $this->get_http_header();
     $end_point = $this->get_end_point();
     require_once Mage::getBaseDir('lib') . '/metododepago2/TodoPago.php';
     $connector = new TodoPago($http_header, $wsdls, $end_point);
     $merchant = Mage::getStoreConfig('payment/todopago_modo/idstore');
     try {
         return $connector->getAllPaymentMethods(array('MERCHANT' => $merchant));
     } catch (Exception $e) {
         $exception['Operations']['Exception'] = $e;
         return $exception;
     }
 }