diff --git a/README.md b/README.md index 3c86375..766a7f8 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ * [O que é o projeto](#o-que-%C3%A9-o-projeto) * [Requisitos](#requisitos) * [Instalação](#instala%C3%A7%C3%A3o) -* [Atualização](#atualiza%C3%A7%C3%A3o-da-vers%C3%A3o-free-para-vers%C3%A3o-pro) +* [Changelog](#changelog) * [Token e Key](#token-e-key-de-produ%C3%A7%C3%A3o) * [Configuração Básica](#configura%C3%A7%C3%A3o-b%C3%A1sica) * [Parcelas](#parcelas) -* [Desinstalação](#desinstala%C3%A7%C3%A3o) -* [Para Outras Versões](#para-outras-versoes) ### O que é o projeto. O projeto "MOIP Transparente", foi criado para facilitar a compra para o usuário final. O projeto quando instalado tem a função de tornar a compra mais fácil pois ele 'elimina' o famoso 'redirecionamento'. @@ -24,29 +22,17 @@ Você pode ter um aumento de até 30% na conversão de suas vendas, uma vez que, Os dados de pagamento dos seus clientes são direcionados diretamente do navegador para o Moip. Sem passar por seus servidores, assim não precisa se preocupar com a segurança destas informações. ### Requisitos -* **OpenCart:** 1.5.1, 1.5.1.3, 1.5.2.1, 1.5.3, 1.5.3.1, 1.5.4, 1.5.4.1 -* **VQmod:** Sim +* **OpenCart:** 1.5.1 ou superior +* **VQmod:** Sim (Apenas 1.5.x) * **jQuery:** 1.7 ou superior * **ColorBox:** Sim +### Changelog +##### 2.2.0 +Suporte para OpenCart 2.2.x + ### Instalação -1. Extraia o arquivo moip.zip no seu comp1tador. -2. Copie as pastas "admin", "catalog", "image", "valdeir", "vqmod", "system" e o arquivo "retorno_moip.php" para a raiz de sua loja. -3. Acesse [http://www.SEUDOMINIO.com.br/valdeir/moip/](javascript:void(0). -4. Clique em Instalar -5. Faça seu login com o usuário e senha do admin. -6. Preencha todos os dados - -### Atualização da versão Free para versão Pro -* 1 - Extraia o arquivo moip.zip no seu computador. -* 2 - Copie as pastas "admin", "catalog", "image", "valdeir", "system" e o arquivo "retorno_moip.php" para a raiz de sua loja. -* 3 - Acesse [http://www.SEUDOMINIO.com.br/valdeir/moip/](javascript:void(0). -* 4 - Clique em atualizar. -* 5 - Faça seu login com o usuário e senha do admin. -* 6 - Acesse [http://www.SEUDOMINIO.com.br/valdeir/moip/](javascript:void(0). -* 7 - Clique em Instalar -* 8 - Faça seu login com o usuário e senha do admin. -* 9 - Preencha todos os dados +https://www.youtube.com/watch?v=zFxeLd16Rrg ### Token e Key de Produção Para receber o Token e Key de produção, seu site deverá ser homologado pela equipe do MoiP para isso basta acessar: @@ -57,16 +43,16 @@ Para receber o Token e Key de produção, seu site deverá ser homologado pela e ### Token e Key de Teste Para receber o Token e Key de produção, seu site deverá ser homologado pela equipe do MoiP para isso basta se cadastrar no site: -* 1 - [http://labs.moip.com.br/login](javascript:void(0)). +* 1 - http://labs.moip.com.br/login * 2 - Depois de cadastrado, faça seu login. * 3 - Acesse o menu Ferramentas > API MoiP > Chaves de Acesso. ### Retorno Automático Para seu cliente receber a notificação do status de pagamento automáticamente é necessário casdastrar sua url de retorno automático, para isso basta acessar: -* 1 - [https://www.moip.com.br/](javascript:void(0)) +* 1 - https://www.moip.com.br/ * 2 - Ir no menu Meus Dados > Preferências > Notificação das transações * 3 - Marcar a opção Receber notificação instantânea de transação -* 4 - Cadastar sua url em URL de notificação (ex: http://www.SEUDOMINIO.com.br/retorno_moip.php). +* 4 - Cadastar sua url em URL de notificação (ex: [http://www.SUA-LOJA.com/modules/index.php?route=payment/moip/callback](javascript:void(0)). * 5 - Clicar em Confirmar Alterações. ### Configuração Básica. @@ -91,7 +77,7 @@ Para seu cliente receber a notificação do status de pagamento automáticamente ### Parcelas O módulo Moip Checkout Transparente Pro oferece total flexibilidade e transparência para você configurar as suas regras de parcelamento de acordo com a estratégia e necessidade do seu negócio. Para aceitar um pagamento parcelado com cartão de crédito você deverá acessar: -* 1 - Acesse [http://www.SEUDOMINIO.com.br/admin/](javascript:void(0) +* 1 - Acesse [http://www.SEUDOMINIO.com.br/admin/](javascript:void(0)) * 2 - Acessar o menu Extensões > Pagamento > Clique em editar ao lado de MoIP > Logo após isso selecione a opção Parcelas (ao lado esquerdo) * 3 - Clique em Adicionar e define os valores de "De*", "Para**" e "Juros***" @@ -112,15 +98,9 @@ Se a quantidade mínima de parcelas for igual em mais de uma configuração, pre Se houver duas configurações com quantidade de parcelas iguais, o sistema vai configurar aleatoriamente, garantindo que não haja erro na transação. -### Desinstalação. -* 1 - Acesse: [http://www.SEUDOMINIO.com.br/valdeir/moip/](javascript:void(0). -* 2 - Clique em Desinstalar. -* 3 - Faça seu login. -* 4 - Confirme que deseja desinstalar o módulo. -* 5 - Pronto! O Módulo foi desinstalado com sucesso. +[![Donate](https://www.paypalobjects.com/pt_BR/BR/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5262W5FHDE6KA) -### Para Outras Versoes -[Acessar](https://www.dropbox.com/sh/l4u1y4t292agk3n/WtpXcc3vO8) +[![Donate](https://p.simg.uol.com.br/out/pagseguro/i/botoes/doacoes/209x48-doar-assina.gif)](https://pagseguro.uol.com.br/checkout/v2/donation.html?currency=BRL&receiverEmail=valdeirpsr@hotmail.com.br) Agradecimentos. -Muito Obrigado a todos. \ No newline at end of file +Muito Obrigado a todos. diff --git a/admin/controller/moip/funcoes.php b/admin/controller/moip/funcoes.php deleted file mode 100644 index a710eb2..0000000 --- a/admin/controller/moip/funcoes.php +++ /dev/null @@ -1,155 +0,0 @@ -query('DROP TABLE IF EXISTS `'.DB_PREFIX.$table.'`'); - endforeach; - - foreach ($arquivos as $arquivo): - unlink($arquivo); - endforeach; - - foreach ($pastas as $pasta): - rmdir($pasta); - endforeach; \ No newline at end of file diff --git a/admin/controller/moip/moip.php b/admin/controller/moip/moip.php deleted file mode 100644 index 739f059..0000000 --- a/admin/controller/moip/moip.php +++ /dev/null @@ -1,318 +0,0 @@ -language->load('moip/moip'); - $this->document->setTitle($this->language->get('heading_title')); - - $this->getList(); - } - - public function getList() { - /* Carrega o arquivo de linguagem */ - $this->language->load('moip/moip'); - $this->document->setTitle($this->language->get('heading_title')); - $this->data['heading_title'] = $this->language->get('heading_title'); - - $url = ''; - - /* Verifica se existe um filtro de busca por ID do pedido */ - if (isset($this->request->get['filter_order_id'])): - $filter_order_id = $this->request->get['filter_order_id']; - $url .= '&filter_order_id='.$this->request->get['filter_order_id']; - else: - $filter_order_id = null; - endif; - - /* Verifica se existe um filtro de busca por nome do cliente */ - if (isset($this->request->get['filter_customer'])): - $filter_customer = $this->request->get['filter_customer']; - $url .= '&filter_customer='.$this->request->get['filter_customer']; - else: - $filter_customer = null; - endif; - - /* Verifica se existe um filtro de busca por status */ - if (isset($this->request->get['filter_order_status_id'])): - $filter_order_status_id = $this->request->get['filter_order_status_id']; - $url .= '&filter_order_status_id='.$this->request->get['filter_order_status_id']; - else: - $filter_order_status_id = null; - endif; - - /* Verifica se existe um filtro de busca por total do pedido */ - if (isset($this->request->get['filter_total'])): - $filter_total = $this->request->get['filter_total']; - $url .= '&filter_total='.$this->request->get['filter_total']; - else: - $filter_total = null; - endif; - - /* Verifica se existe um filtro de busca por data de adio */ - if (isset($this->request->get['filter_date_added'])): - $filter_date_added = $this->request->get['filter_date_added']; - $url .= '&filter_date_added='.$this->request->get['filter_date_added']; - else: - $filter_date_added = null; - endif; - - /* Verifica se existe um filtro de busca por data de modificao */ - if (isset($this->request->get['filter_date_modified'])): - $filter_date_modified = $this->request->get['filter_date_modified']; - $url .= '&filter_date_modified='.$this->request->get['filter_date_modified']; - else: - $filter_date_modified = null; - endif; - - /* Verifica se existe um filtro de reogarnizao por ordem Crescente ou Decrescente */ - if (isset($this->request->get['sort'])): - $sort = $this->request->get['sort']; - $url .= '&sort='.$this->request->get['sort']; - else: - $sort = null; - endif; - - /* Verifica se existe um filtro de busca por 'order' */ - if (isset($this->request->get['order'])): - $order = $this->request->get['order']; - $url .= '&order='.$this->request->get['order']; - else: - $order = null; - endif; - - /* Verifica em qual pgina o usurio est */ - if (isset($this->request->get['page'])): - $page = $this->request->get['page']; - $url .= '&page='.$this->request->get['page']; - else: - $page = 1; - endif; - - /* Adiciona as vriaveis acima nas variaveis $this-data[] para ser exibido no arquivo moip_form.tpl */ - $this->data['filter_order_id'] = $filter_order_id; - $this->data['filter_customer'] = $filter_customer; - $this->data['filter_status'] = $filter_order_status_id; - $this->data['filter_total'] = $filter_total; - $this->data['filter_date_added'] = $filter_date_added; - $this->data['filter_date_modified'] = $filter_date_modified; - - /* Adiciona os valores das variaveis acima na variavl $data (variavel responsavel por filtrar os resultados) */ - $data = array( - 'filter_order_id' => $filter_order_id, - 'filter_customer' => $filter_customer, - 'filter_order_status_id' => $filter_order_status_id, - 'filter_total' => $filter_total, - 'filter_date_added' => $filter_date_added, - 'filter_date_modified' => $filter_date_modified, - 'sort' => $sort, - 'order' => $order, - 'start' => ($page - 1) * $this->config->get('config_admin_limit'), - 'limit' => $this->config->get('config_admin_limit') - ); - - /* Carrega o model moi/moip */ - $this->load->model('moip/moip'); - - /* Carrega o model com as informaes de status */ - $this->load->model('localisation/order_status'); - - /* Adiciona os informaes de dados na varivel */ - $this->data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses(); - - /* Captura todas os pedidos com os filtros definidos mais acima */ - $results = $this->model_moip_moip->getOrders($data); - - /* Captura o total de compras */ - $order_total = $this->model_moip_moip->getTotalOrders($data); - - - foreach ($results as $result) { - $action = array(); - - $action[] = array( - 'text' => 'Visualizar', - 'href' => $this->url->link('moip/moip/getInfo', 'token=' . $this->session->data['token'] . '&order_id=' . $result['order_id'], 'SSL') - ); - - /* Adiciona os dados no array $this->data['orders'][] */ - $this->data['orders'][] = array( - 'order_id' => $result['order_id'], - 'customer' => $result['customer'], - 'status' => $result['status'], - 'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']), - 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), - 'date_modified' => date($this->language->get('date_format_short'), strtotime($result['date_modified'])), - 'selected' => isset($this->request->post['selected']) && in_array($result['order_id'], $this->request->post['selected']), - 'action' => $action - ); - - } - - /* Pginao */ - $pagination = new Pagination(); - $pagination->total = $order_total; - $pagination->page = $page; - $pagination->limit = $this->config->get('config_admin_limit'); - $pagination->text = $this->language->get('text_pagination'); - $pagination->url = $this->url->link('moip/moip', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL'); - $this->data['pagination'] = $pagination->render(); - - /* Breadcrumbs - Inicio */ - $url = ''; - - if (isset($this->request->get['page'])) { - $url .= '&page=' . $this->request->get['page']; - } - - $this->data['breadcrumbs'] = array(); - - $this->data['breadcrumbs'][] = array( - 'text' => $this->language->get('text_home'), - 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), - 'separator' => false - ); - - $this->data['breadcrumbs'][] = array( - 'text' => $this->language->get('heading_title'), - 'href' => $this->url->link('report/product_viewed', 'token=' . $this->session->data['token'] . $url, 'SSL'), - 'separator' => ' :: ' - ); - /* Breadcrumbs - Fim */ - - $this->template = 'moip/moip_form.tpl'; - $this->children = array( - 'common/header', - 'common/footer' - ); - - $this->response->setOutput($this->render()); - } - - public function getInfo() { - - /* Carrega o arquivo de linguagem */ - $this->load->language('moip/moip'); - $this->document->setTitle('MoIP | Info'); - - /* Carrega o model moip */ - $this->load->model('moip/moip'); - - /* Verifica se o existe ou se est vazio o parmetro, caso esteja redireciona */ - if (!isset($this->request->get['order_id']) || empty($this->request->get['order_id'])) - $this->redirect($this->url->link('moip/moip&token=' . $this->session->data['token'] , '', 'SSL')); - - /* Recebe o ID da compra passado pela url */ - $order_id = $this->request->get['order_id']; - - /* Captura os dados da compra selecionada */ - $this->data['data_order'] = $this->model_moip_moip->getOrder($order_id); - - /* Formata Moeda */ - $this->data['data_order']['total'] = $this->currency->format($this->data['data_order']['currency_id'], $this->data['data_order']['currency_code'], $this->data['data_order']['total']); - - /* Captura o nome do grupo do cliente */ - $this->data['data_order']['customer_group_name'] = $this->model_moip_moip->getCustomerGroup($this->data['data_order']['customer_group_id']); - - $this->data['data_order']['order_status_name'] = $this->model_moip_moip->getOrderStatus($this->data['data_order']['order_status_id']); - - $this->data['data_order']['commission'] = $this->currency->format($this->data['data_order']['currency_id'], $this->data['data_order']['currency_code'], $this->data['data_order']['commission']); - - /* Captura os dados dos produtos da compra */ - $this->data['data_products'] = $this->model_moip_moip->getOrderProducts($order_id); - - /* Captura o sub-total, valor do frete e valor total */ - $this->data['totals_order'] = $this->model_moip_moip->getOrderTotals($order_id); - - /* Captura todos os histricos criado */ - $histories_order = $this->model_moip_moip->getOrderHistories($order_id,0,40); - - $this->data['histories_order'] = array(); - - foreach ($histories_order as $hitory_order): - - $this->data['histories_order'][] = array( - 'date_added' => date('d/m/Y', strtotime($hitory_order['date_added'])), - 'status' => $hitory_order['status'], - 'comment' => $hitory_order['comment'], - 'notify' => $hitory_order['notify'] ? 'Sim' : 'Nao' - ); - - endforeach; - - /* Captura os dados da tabela moip_nasp e adiciona nas variaveis citadas abaixo */ - $this->data['moip_order'] = $this->model_moip_moip->getMoipNasp($order_id); - - /* Adiciona o simbolo R$ antes do valor */ - $this->data['moip_order']['valor'] = 'R$'.$this->format_money($this->data['moip_order']['valor']); - - /* Captura o nome do status de pagamento atraves do ID */ - $this->data['moip_order']['status_pagamento'] = $this->model_moip_moip->getStatusPaymentMoip($this->data['moip_order']['status_pagamento']); - - /* Captaura o nome da forma de pagamento */ - $this->data['moip_order']['forma_pagamento'] = $this->model_moip_moip->getFormaPagamento($this->data['moip_order']['forma_pagamento']); - - /* Concatena os 6 primeiros e 4 ltimos digitos do carto */ - $this->data['moip_order']['num_cartao'] = $this->data['moip_order']['cartao_bin'].'.****.****.'.$this->data['moip_order']['cartao_final']; - - /* Links */ - $this->data['link_order_update'] = $this->url->link('sale/order/info&token=' . $this->session->data['token'] . '&order_id=' . $order_id, '', 'SSL'); - $this->data['link_cancel'] = $this->url->link('moip/moip&token=' . $this->session->data['token'] . '&order_id=' . $order_id, '', 'SSL'); - - /* Breadcrumbs - Inicio */ - $this->data['breadcrumbs'] = array(); - - $this->data['breadcrumbs'][] = array( - 'separator' => false, - 'href' => $this->url->link('common/home&token=' . $this->session->data['token']), - 'text' => 'Principal' - ); - - $this->data['breadcrumbs'][] = array( - 'separator' => ' :: ', - 'href' => $this->url->link('common/home&token=' . $this->session->data['token']), - 'text' => 'MoIP' - ); - /* Breadcrumbs - Fim */ - - $this->template = 'moip/moip_info.tpl'; - $this->children = array( - 'common/header', - 'common/footer' - ); - - $this->response->setOutput($this->render()); - - } - - public function teste() { - - $this->load->model('moip/moip'); - - $resultado = $this->model_moip_moip->getOrder(9); - $resultado2 = $this->model_moip_moip->getOrderProducts(9); - - var_dump($resultado); - var_dump($resultado2); - - $this->template = 'moip/testes.tpl'; - $this->children = array( - 'common/header', - 'common/footer' - ); - - $this->response->setOutput($this->render()); - - } - - private function format_money($total){ - if(strlen($total)>2){ - $n=strlen($total)-2; - $preco=substr($total,0,$n).",".substr($total,$n); - return $preco; - }else{ - return $total; - } - } -} -?> \ No newline at end of file diff --git a/admin/controller/payment/moip.php b/admin/controller/payment/moip.php deleted file mode 100644 index 7a8cbad..0000000 --- a/admin/controller/payment/moip.php +++ /dev/null @@ -1 +0,0 @@ -load->language('payment/moip'); /* Define o com o título do módulo */ $this->document->setTitle($this->language->get('heading_title')); /* Carrega o model de configurções */ $this->load->model('setting/setting'); /* Salva as informações */ if (($this->request->server['REQUEST_METHOD'] == 'POST') && ($this->validate())) { $this->load->model('setting/setting'); $this->model_setting_setting->editSetting('moip', $this->request->post); $this->session->data['success'] = $this->language->get('text_success'); $this->redirect(HTTPS_SERVER . 'index.php?route=extension/payment&token=' . $this->session->data['token']); } $this->data['heading_title'] = $this->language->get('heading_title'); /* Text */ $this->data['text_enabled'] = $this->language->get('text_enabled'); $this->data['text_disabled'] = $this->language->get('text_disabled'); $this->data['text_all_zones'] = $this->language->get('text_all_zones'); $this->data['text_yes'] = $this->language->get('text_yes'); $this->data['text_no'] = $this->language->get('text_no'); /* Tabs */ $this->data['tab_config'] = $this->language->get('tab_config'); $this->data['tab_status'] = $this->language->get('tab_status'); $this->data['tab_order'] = $this->language->get('tab_order'); $this->data['tab_parcelas'] = $this->language->get('tab_parcelas'); $this->data['tab_boleto'] = $this->language->get('tab_boleto'); $this->data['tab_formasPagamento'] = $this->language->get('tab_formasPagamento'); $this->data['tab_committee'] = $this->language->get('tab_committee'); $this->data['tab_suporte'] = $this->language->get('tab_suporte'); /* Entry - Configurações */ $this->data['entry_status'] = $this->language->get('entry_status'); $this->data['entry_razao'] = $this->language->get('entry_razao'); $this->data['entry_apitoken'] = $this->language->get('entry_apitoken'); $this->data['entry_apikey'] = $this->language->get('entry_apikey'); $this->data['entry_test'] = $this->language->get('entry_test'); $this->data['entry_notify'] = $this->language->get('entry_notify'); $this->data['entry_modoParcela'] = $this->language->get('entry_modoParcela'); $this->data['entry_valorTotal'] = $this->language->get('entry_valorTotal'); /* Entry - Status de Pagamento */ $this->data['entry_autorizdo'] = $this->language->get('entry_autorizdo'); $this->data['entry_iniciado'] = $this->language->get('entry_iniciado'); $this->data['entry_boletoimpresso'] = $this->language->get('entry_boletoimpresso'); $this->data['entry_concluido'] = $this->language->get('entry_concluido'); $this->data['entry_cancelado'] = $this->language->get('entry_cancelado'); $this->data['entry_emanalise'] = $this->language->get('entry_emanalise'); $this->data['entry_estornado'] = $this->language->get('entry_estornado'); $this->data['entry_revisao'] = $this->language->get('entry_revisao'); $this->data['entry_reembolsado'] = $this->language->get('entry_reembolsado'); /* Entry - Área e Ordem */ $this->data['entry_geo_zone'] = $this->language->get('entry_geo_zone'); $this->data['entry_sort_order'] = $this->language->get('entry_sort_order'); /* Entry - Parcelas */ $this->data['entry_parcelaDe'] = $this->language->get('entry_parcelaDe'); $this->data['entry_parcelaPara'] = $this->language->get('entry_parcelaPara'); $this->data['entry_parcelaJuros'] = $this->language->get('entry_parcelaJuros'); /* Entry - Boleto */ $this->data['entry_boletoPrazo'] = $this->language->get('entry_boletoPrazo'); $this->data['entry_boletoInstrucao'] = $this->language->get('entry_boletoInstrucao'); $this->data['entry_boletoUrlLogo'] = $this->language->get('entry_boletoUrlLogo'); /* Entry - Formas de Pagamento */ $this->data['entry_cartaoCredito'] = $this->language->get('entry_cartaoCredito'); $this->data['entry_boleto'] = $this->language->get('entry_boleto'); $this->data['entry_debito'] = $this->language->get('entry_debito'); /* Entry - Comissão */ $this->data['entry_habilitar'] = $this->language->get('entry_habilitar'); $this->data['entry_valor'] = $this->language->get('entry_valor'); $this->data['entry_fixo'] = $this->language->get('entry_fixo'); $this->data['entry_percentual'] = $this->language->get('entry_percentual'); $this->data['entry_pagadorTaxa'] = $this->language->get('entry_pagadorTaxa'); $this->data['entry_aLoja'] = $this->language->get('entry_aLoja'); $this->data['entry_afiliado'] = $this->language->get('entry_afiliado'); /* Entry - Suporte */ $this->data['entry_suporteAssunto'] = $this->language->get('entry_suporteAssunto'); $this->data['entry_suporteMensagem'] = $this->language->get('entry_suporteMensagem'); $this->data['attention_suporte'] = $this->language->get('attention_suporte'); $this->data['success_supórte'] = $this->language->get('success_supórte'); /* Helps */ $this->data['help_razao'] = $this->language->get('help_razao'); $this->data['help_notify'] = $this->language->get('help_notify'); $this->data['help_autorizado'] = $this->language->get('help_autorizado'); $this->data['help_iniciado'] = $this->language->get('help_iniciado'); $this->data['help_boletoimpresso'] = $this->language->get('help_boletoimpresso'); $this->data['help_concluido'] = $this->language->get('help_concluido'); $this->data['help_cancelado'] = $this->language->get('help_cancelado'); $this->data['help_emanalise'] = $this->language->get('help_emanalise'); $this->data['help_estornado'] = $this->language->get('help_estornado'); $this->data['help_revisao'] = $this->language->get('help_revisao'); $this->data['help_reembolsado'] = $this->language->get('help_reembolsado'); $this->data['help_boletoUrlLogo'] = $this->language->get('help_boletoUrlLogo'); /* Botões */ $this->data['button_adicionar'] = $this->language->get('button_adicionar'); $this->data['button_remover'] = $this->language->get('button_remover'); $this->data['button_save'] = $this->language->get('button_save'); $this->data['button_cancel'] = $this->language->get('button_cancel'); $this->data['button_enviar'] = $this->language->get('button_enviar'); /* Error */ if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } /* Error */ $this->data['error_email'] = $this->language->get('error_email'); /* Breadcrumbs - Inicio */ $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array( 'href' => $this->url->link('common/home&token=', $this->session->data['token']), 'text' => $this->language->get('text_home'), 'separator' => FALSE ); $this->data['breadcrumbs'][] = array( 'href' => $this->url->link('extension/payment&token=',$this->session->data['token']), 'text' => $this->language->get('text_payment'), 'separator' => ' :: ' ); $this->data['breadcrumbs'][] = array( 'href' => $this->url->link('payment/moip&token=', $this->session->data['token']), 'text' => $this->language->get('heading_title'), 'separator' => ' :: ' ); /* Breadcrumbs - Fim */ /* Botões */ $this->data['action'] = $this->url->link('payment/moip', 'token=' . $this->session->data['token']); $this->data['cancel'] = $this->url->link('extension/payment', 'token=' . $this->session->data['token']); /* Status */ if (isset($this->request->post['moip_status'])) { $this->data['moip_status'] = $this->request->post['moip_status']; } else { $this->data['moip_status'] = $this->config->get('moip_status'); } /* Notify */ if (isset($this->request->post['moip_notify'])) { $this->data['moip_notify'] = $this->request->post['moip_notify']; } else { $this->data['moip_notify'] = $this->config->get('moip_notify'); } /* Modo Teste */ if (isset($this->request->post['moip_test'])) { $this->data['moip_test'] = $this->request->post['moip_test']; } else { $this->data['moip_test'] = $this->config->get('moip_test'); } /* Razão */ if (isset($this->request->post['moip_razao'])) { $this->data['moip_razao'] = $this->request->post['moip_razao']; } else { $this->data['moip_razao'] = $this->config->get('moip_razao'); } /* Token */ if (isset($this->request->post['moip_apitoken'])) { $this->data['moip_apitoken'] = $this->request->post['moip_apitoken']; } else { $this->data['moip_apitoken'] = $this->config->get('moip_apitoken'); } /* Key */ if (isset($this->request->post['moip_apikey'])) { $this->data['moip_apikey'] = $this->request->post['moip_apikey']; } else { $this->data['moip_apikey'] = $this->config->get('moip_apikey'); } /* Autorizado */ if (isset($this->request->post['moip_apikey'])) { $this->data['moip_autorizado'] = $this->request->post['moip_autorizado']; } else { $this->data['moip_autorizado'] = $this->config->get('moip_autorizado'); } /* Iniciado */ if (isset($this->request->post['moip_iniciado'])) { $this->data['moip_iniciado'] = $this->request->post['moip_iniciado']; } else { $this->data['moip_iniciado'] = $this->config->get('moip_iniciado'); } /* Boleto Impresso */ if (isset($this->request->post['moip_boletoimpresso'])) { $this->data['moip_boletoimpresso'] = $this->request->post['moip_boletoimpresso']; } else { $this->data['moip_boletoimpresso'] = $this->config->get('moip_boletoimpresso'); } /* Concluido */ if (isset($this->request->post['moip_concluido'])) { $this->data['moip_concluido'] = $this->request->post['moip_concluido']; } else { $this->data['moip_concluido'] = $this->config->get('moip_concluido'); } /* Cancelado */ if (isset($this->request->post['moip_cancelado'])) { $this->data['moip_cancelado'] = $this->request->post['moip_cancelado']; } else { $this->data['moip_cancelado'] = $this->config->get('moip_cancelado'); } /* Em Análise */ if (isset($this->request->post['moip_emanalise'])) { $this->data['moip_emanalise'] = $this->request->post['moip_emanalise']; } else { $this->data['moip_emanalise'] = $this->config->get('moip_emanalise'); } /* Estornado */ if (isset($this->request->post['moip_estornado'])) { $this->data['moip_estornado'] = $this->request->post['moip_estornado']; } else { $this->data['moip_estornado'] = $this->config->get('moip_estornado'); } /* Em Revisão */ if (isset($this->request->post['moip_revisao'])) { $this->data['moip_revisao'] = $this->request->post['moip_revisao']; } else { $this->data['moip_revisao'] = $this->config->get('moip_revisao'); } /* Reembolsado */ if (isset($this->request->post['moip_reembolsado'])) { $this->data['moip_reembolsado'] = $this->request->post['moip_reembolsado']; } else { $this->data['moip_reembolsado'] = $this->config->get('moip_reembolsado'); } /* Parcelas */ if (isset($this->request->post['moip_parcelas'])) { $this->data['moip_parcelas'] = serialize($this->request->post['moip_parcelas']); } else { $this->data['moip_parcelas'] = $this->config->get('moip_parcelas'); } /* Carrega o model de locação de zona geográfica */ $this->load->model('localisation/geo_zone'); /* Captura todas as zonas */ $this->data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones(); /* Zone Selecionada */ if (isset($this->request->post['moip_geo_zone_id'])) { $this->data['moip_geo_zone_id'] = $this->request->post['moip_geo_zone_id']; } else { $this->data['moip_geo_zone_id'] = $this->config->get('moip_geo_zone_id'); } /* Status do pedido quando estive aguardando pagamento pelo moip */ if (isset($this->request->post['moip_aguardando'])) { $this->data['moip_aguardando'] = $this->request->post['moip_aguardando']; } else { $this->data['moip_aguardando'] = $this->config->get('moip_aguardando'); } /* Status do pedido quando for cancelado pelo moip */ if (isset($this->request->post['moip_cancelado'])) { $this->data['moip_cancelado'] = $this->request->post['moip_cancelado']; } else { $this->data['moip_cancelado'] = $this->config->get('moip_cancelado'); } /* Status do pedido quando for aprovando pelo moip */ if (isset($this->request->post['moip_aprovado'])) { $this->data['moip_aprovado'] = $this->request->post['moip_aprovado']; } else { $this->data['moip_aprovado'] = $this->config->get('moip_aprovado'); } /* Status do pedido quando for Analize pelo moip */ if (isset($this->request->post['moip_analize'])) { $this->data['moip_analize'] = $this->request->post['moip_analize']; } else { $this->data['moip_analize'] = $this->config->get('moip_analize'); } /* Dias corridos para o prazo do boleto */ if (isset($this->request->post['moip_diasCorridosBoleto'])) { $this->data['moip_diasCorridosBoleto'] = $this->request->post['moip_diasCorridosBoleto']; } else { $this->data['moip_diasCorridosBoleto'] = $this->config->get('moip_diasCorridosBoleto'); } /* Instrução 1 do boleto */ if (isset($this->request->post['moip_instrucaoUmBoleto'])) { $this->data['moip_instrucaoUmBoleto'] = $this->request->post['moip_instrucaoUmBoleto']; } else { $this->data['moip_instrucaoUmBoleto'] = $this->config->get('moip_instrucaoUmBoleto'); } /* Instrução 2 do Boleto */ if (isset($this->request->post['moip_instrucaoDoisBoleto'])) { $this->data['moip_instrucaoDoisBoleto'] = $this->request->post['moip_instrucaoDoisBoleto']; } else { $this->data['moip_instrucaoDoisBoleto'] = $this->config->get('moip_instrucaoDoisBoleto'); } /* Instrução 3 do Boleto */ if (isset($this->request->post['moip_instrucaoTresBoleto'])) { $this->data['moip_instrucaoTresBoleto'] = $this->request->post['moip_instrucaoTresBoleto']; } else { $this->data['moip_instrucaoTresBoleto'] = $this->config->get('moip_instrucaoTresBoleto'); } /* Url da Logo para o Boleto */ if (isset($this->request->post['moip_urlLogoBoleto'])) { $this->data['moip_urlLogoBoleto'] = $this->request->post['moip_urlLogoBoleto']; } else { $this->data['moip_urlLogoBoleto'] = $this->config->get('moip_urlLogoBoleto'); } /* Modo como as parcelas irão ser exibidas */ if (isset($this->request->post['moip_modoParcelas'])) { $this->data['moip_modoParcelas'] = $this->request->post['moip_modoParcelas']; } else { $this->data['moip_modoParcelas'] = $this->config->get('moip_modoParcelas'); } /* Exibi valor total das parcelas */ if (isset($this->request->post['moip_exibiTotalParcela'])) { $this->data['moip_exibiTotalParcela'] = $this->request->post['moip_exibiTotalParcela']; } else { $this->data['moip_exibiTotalParcela'] = $this->config->get('moip_exibiTotalParcela'); } /* Verifica se o comissionamento está habilitado */ if (isset($this->request->post['moip_comissao'])) { $this->data['moip_comissao'] = $this->request->post['moip_comissao']; } else { $this->data['moip_comissao'] = $this->config->get('moip_comissao'); } /* Captura o valor do comissionamento */ if (isset($this->request->post['moip_valorComissao'])) { $this->data['moip_valorComissao'] = $this->request->post['moip_valorComissao']; } else { $this->data['moip_valorComissao'] = $this->config->get('moip_valorComissao'); } /* Verifica se o tipo de pagamento da comissão é fixo ou percentual */ if (isset($this->request->post['moip_tipoPagamentoComissao'])) { $this->data['moip_tipoPagamentoComissao'] = $this->request->post['moip_tipoPagamentoComissao']; } else { $this->data['moip_tipoPagamentoComissao'] = $this->config->get('moip_tipoPagamentoComissao'); } /* Responsavel por pagar taxa do moip, em caso do comissionamento estiver ativado */ if (isset($this->request->post['moip_pagadorTaxa'])) { $this->data['moip_pagadorTaxa'] = $this->request->post['moip_pagadorTaxa']; } else { $this->data['moip_pagadorTaxa'] = $this->config->get('moip_pagadorTaxa'); } /* Carrega o model order_status */ $this->load->model('localisation/order_status'); /* Captura todos os status cadastrado */ $this->data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses(); /* Ordem do Módulo */ if (isset($this->request->post['moip_sort_order'])) { $this->data['moip_sort_order'] = $this->request->post['moip_sort_order']; } else { $this->data['moip_sort_order'] = $this->config->get('moip_sort_order'); } /* Acc Cartão de Crédito */ if (isset($this->request->post['moip_accCartaoCredito'])) { $this->data['moip_accCartaoCredito'] = $this->request->post['moip_accCartaoCredito']; } else { $this->data['moip_accCartaoCredito'] = $this->config->get('moip_accCartaoCredito'); } /* Acc Boleto */ if (isset($this->request->post['moip_accBoleto'])) { $this->data['moip_accBoleto'] = $this->request->post['moip_accBoleto']; } else { $this->data['moip_accBoleto'] = $this->config->get('moip_accBoleto'); } /* Acc Débito */ if (isset($this->request->post['moip_accDebito'])) { $this->data['moip_accDebito'] = $this->request->post['moip_accDebito']; } else { $this->data['moip_accDebito'] = $this->config->get('moip_accDebito'); } /* Captura quais layouts serão carregados */ $this->id = 'content'; $this->template = 'payment/moip.tpl'; $this->children = array( 'common/header', 'common/footer' ); /* Carrega Layout */ $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); } /* Função Para envio do Suporte */ public function suporte() { $assunto = $this->request->get['suporteAssunto']; $mensagem = $this->request->get['suporteMensagem']; $mensagem .= '

Site: '.HTTP_CATALOG; $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->hostname = $this->config->get('config_smtp_host'); $mail->username = $this->config->get('config_smtp_username'); $mail->password = $this->config->get('config_smtp_password'); $mail->port = $this->config->get('config_smtp_port'); $mail->timeout = $this->config->get('config_smtp_timeout'); $mail->setTo('valdeirpsr@hotmail.com.br'); $mail->setFrom($this->config->get('config_email')); $mail->setSender($this->config->get('config_name')); $mail->setSubject($assunto); $mail->setHTML($mensagem); $mail->send(); } /* Função para validar os dados quando usuário salvar */ private function validate() { if (!$this->user->hasPermission('modify', 'payment/moip')) { $this->error['warning'] = $this->language->get('error_permission'); } if ($this->request->post['moip_comissao'] == 0) { $dir_catalog = str_replace('catalog/', '', DIR_CATALOG); if (file_exists($dir_catalog . 'vqmod/xml/comissao_moip.xml')){ if (!rename($dir_catalog . 'vqmod/xml/comissao_moip.xml', $dir_catalog . 'vqmod/xml/comissao_moip')) { return false; } } } if ($this->request->post['moip_comissao'] == 1) { $dir_catalog = str_replace('catalog/', '', DIR_CATALOG); if (file_exists($dir_catalog . 'vqmod/xml/comissao_moip')){ if (!rename($dir_catalog . 'vqmod/xml/comissao_moip', $dir_catalog . 'vqmod/xml/comissao_moip.xml')) { return false; } } } if (!$this->request->post['moip_apitoken']) { $this->error['erro_apitoken'] = $this->language->get('erro_apitoken'); } if (!$this->request->post['moip_apikey']) { $this->error['erro_apikey'] = $this->language->get('erro_apikey'); } if (!@$this->request->post['moip_razao']) { $this->error['error_razao'] = $this->language->get('error_razao'); } if (!$this->error) { return TRUE; } else { return FALSE; } } } ?> \ No newline at end of file diff --git a/admin/image/Thumbs.db b/admin/image/Thumbs.db deleted file mode 100644 index 5211e6b..0000000 Binary files a/admin/image/Thumbs.db and /dev/null differ diff --git a/admin/image/flags_moip.jpg b/admin/image/flags_moip.jpg deleted file mode 100644 index f9075db..0000000 Binary files a/admin/image/flags_moip.jpg and /dev/null differ diff --git a/admin/image/moipflag.jpg b/admin/image/moipflag.jpg deleted file mode 100644 index a484afd..0000000 Binary files a/admin/image/moipflag.jpg and /dev/null differ diff --git a/admin/language/english/moip/header.php b/admin/language/english/moip/header.php deleted file mode 100644 index 6ab7525..0000000 --- a/admin/language/english/moip/header.php +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/admin/language/english/payment/moip.php b/admin/language/english/payment/moip.php deleted file mode 100644 index 8c6b679..0000000 --- a/admin/language/english/payment/moip.php +++ /dev/null @@ -1 +0,0 @@ -MoIP'; $_['text_enable'] = 'Enable'; $_['text_disable'] = 'Disable'; $_['text_all_zones'] = 'All ZOnes'; $_['text_yes'] = 'Yes'; $_['text_home'] = 'Home'; /* Buttons */ $_['button_adicionar'] = 'Add'; $_['button_remover'] = 'Remove'; $_['button_save'] = 'Save'; $_['button_cancel'] = 'Cancel'; $_['button_enviar'] = 'Send'; /* Tabs */ $_['tab_config'] = 'Configuration'; $_['tab_status'] = 'Payment Status'; $_['tab_order'] = 'Area and Order'; $_['tab_parcelas'] = 'Plots'; $_['tab_boleto'] = 'Billet'; $_['tab_formasPagamento'] = 'Payment Methods'; $_['tab_suporte'] = 'Support'; $_['tab_committee'] = 'Committee'; /* Entry - Config */ $_['entry_status'] = 'Situation:'; $_['entry_razao'] = 'Reason for payment:'; $_['entry_apitoken'] = 'Token:'; $_['entry_apikey'] = 'Key:'; $_['entry_test'] = 'Test Mode:'; $_['entry_notify'] = 'Notify client?'; $_['entry_modoParcela'] = 'Display with the plots:'; $_['entry_valorTotal'] = 'View the total value of the installments?'; /* Entry - Formas de Pagamento */ $_['entry_autorizdo'] = 'Situation Authorized:'; $_['entry_iniciado'] = 'Situation Started:'; $_['entry_boletoimpresso'] = 'Situation Billet Printed:'; $_['entry_concluido'] = 'Situation Completed:'; $_['entry_cancelado'] = 'Situation Cancelled:'; $_['entry_emanalise'] = 'Situation In Analysis:'; $_['entry_estornado'] = 'Situation Reversed:'; $_['entry_revisao'] = 'Situation In Review:'; $_['entry_reembolsado'] = 'Situation Reimbursed:'; /* Entry - Área e Ordem */ $_['entry_geo_zone'] = 'Geographic Area:'; $_['entry_sort_order'] = 'Order:'; /* Entry - Parcelas */ $_['entry_parcelaDe'] = 'From'; $_['entry_parcelaPara'] = 'To'; $_['entry_parcelaJuros'] = 'Interest Rates'; /* Entry - Boleto */ $_['entry_boletoPrazo'] = 'Time (In Days):'; $_['entry_boletoInstrucao'] = 'Instruction '; $_['entry_boletoUrlLogo'] = 'Url of your logo:'; /* Entry - Formas de Pagamento */ $_['entry_cartaoCredito'] = 'Credit Card:'; $_['entry_boleto'] = 'Billet:'; $_['entry_debito'] = 'Debt:'; /* Entry - Comissão */ $_['entry_habilitar'] = 'Enabled: '; $_['entry_valor'] = 'Value: '; $_['entry_fixo'] = 'Fixed'; $_['entry_percentual'] = 'Percentage'; $_['entry_pagadorTaxa'] = 'Responsible for rate MoIP: '; $_['entry_aLoja'] = 'The Store'; $_['entry_afiliado'] = 'Affiliate'; /* Entry - Suporte */ $_['entry_suporteAssunto'] = 'Subject:'; $_['entry_suporteMensagem'] = 'Message:'; /* Help */ $_['help_razao'] = 'Enter the Reason of payment that can simply be the name of your store.'; $_['help_autorizado'] = 'Situation to identify an application that waits for response MoIP.'; $_['help_iniciado'] = 'Situation to identify an application that was started by MoIP.'; $_['help_boletoimpresso'] = 'Situation to identify an application has the ticket printed.'; $_['help_concluido'] = 'Situation to identify an application that has been completed.'; $_['help_cancelado'] = 'Situation to identify an application that was canceled.'; $_['help_emanalise'] = 'Situation to identify an application that is under consideration by the MoIP.'; $_['help_estornado'] = 'Situation to identify an application that has been reversed.'; $_['help_revisao'] = 'Situation to identify an application that is under review.'; $_['help_reembolsado'] = 'Situation to identify an application that has been repaid.'; $_['help_notify'] = 'Want to notify the customer when the payment status is changed in MoIP?'; $_['help_boletoUrlLogo'] = 'The image must contain 75px by 40px'; /* Attention */ $_['attention_suporte'] = 'Wait your message be sent.'; /* Success */ $_['success_supórte'] = 'Message sent successfully.'; /* Error */ $_['error_permission'] = 'You are not allowed to change the module MoIP!'; $_['error_razao'] = 'You are not allowed to change the module MoIP!'; $_['erro_test'] = 'Please select an option!'; $_['erro_notify'] = 'Please select an option!'; $_['erro_apitoken'] = 'Please enter the code from your token!'; $_['erro_assunto'] = 'Please fill in the subject!'; $_['erro_mensagem'] = 'Please fill in the mensage!'; ?> \ No newline at end of file diff --git a/admin/language/portuguese-br/moip/header.php b/admin/language/portuguese-br/moip/header.php deleted file mode 100644 index 76e47cd..0000000 --- a/admin/language/portuguese-br/moip/header.php +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/admin/language/portuguese-br/payment/moip.php b/admin/language/portuguese-br/payment/moip.php deleted file mode 100644 index 9bd3601..0000000 --- a/admin/language/portuguese-br/payment/moip.php +++ /dev/null @@ -1 +0,0 @@ -MoIP'; $_['text_enable'] = 'Habilitar'; $_['text_disable'] = 'Desabilitar'; $_['text_all_zones'] = 'Todas as Zonas'; $_['text_yes'] = 'Sim'; $_['text_home'] = 'Página Principal'; $_['text_payment'] = 'Formas de Pagamento'; /* Buttons */ $_['button_adicionar'] = 'Adicionar'; $_['button_remover'] = 'Remover'; $_['button_save'] = 'Salvar'; $_['button_cancel'] = 'Cancelar'; $_['button_enviar'] = 'Enviar'; /* Tabs */ $_['tab_config'] = 'Configurações'; $_['tab_status'] = 'Status de Pagamento'; $_['tab_order'] = 'Área e Ordem'; $_['tab_parcelas'] = 'Parcelas'; $_['tab_boleto'] = 'Boleto'; $_['tab_formasPagamento'] = 'Formas de Pagamento'; $_['tab_committee'] = 'Comissão'; $_['tab_suporte'] = 'Suporte'; /* Entry - Config */ $_['entry_status'] = 'Situação:'; $_['entry_razao'] = 'Razão do pagamento:'; $_['entry_apitoken'] = 'Token:'; $_['entry_apikey'] = 'Key:'; $_['entry_test'] = 'Modo de Teste:'; $_['entry_notify'] = 'Notificar cliente?'; $_['entry_modoParcela'] = 'Exibi as parcelas com:'; $_['entry_valorTotal'] = 'Exibi valor total das parcelas?'; /* Entry - Formas de Pagamento */ $_['entry_autorizdo'] = 'Situação Autorizado:'; $_['entry_iniciado'] = 'Situação Iniciado:'; $_['entry_boletoimpresso'] = 'Situação Boleto Impresso:'; $_['entry_concluido'] = 'Situação Concluído:'; $_['entry_cancelado'] = 'Situação Cancelado:'; $_['entry_emanalise'] = 'Situação Em Análise:'; $_['entry_estornado'] = 'Situação Estornado:'; $_['entry_revisao'] = 'Situação Em Revisão:'; $_['entry_reembolsado'] = 'Situação Reembolsado:'; /* Entry - Área e Ordem */ $_['entry_geo_zone'] = 'Zona Geográfica:'; $_['entry_sort_order'] = 'Ordem:'; /* Entry - Parcelas */ $_['entry_parcelaDe'] = 'De'; $_['entry_parcelaPara'] = 'Para'; $_['entry_parcelaJuros'] = 'Juros'; /* Entry - Boleto */ $_['entry_boletoPrazo'] = 'Prazo:'; $_['entry_boletoInstrucao'] = 'Instrução '; $_['entry_boletoUrlLogo'] = 'Url de sua logo:'; /* Entry - Formas de Pagamento */ $_['entry_cartaoCredito'] = 'Cartão de Crédito:'; $_['entry_boleto'] = 'Boleto:'; $_['entry_debito'] = 'Débito:'; /* Entry - Comissão */ $_['entry_habilitar'] = 'Habilitar: '; $_['entry_valor'] = 'Valor: '; $_['entry_fixo'] = 'Fixo'; $_['entry_percentual'] = 'Percentual'; $_['entry_pagadorTaxa'] = 'Responsável pela Taxa MoIP: '; $_['entry_aLoja'] = 'A Loja'; $_['entry_afiliado'] = 'Afiliado'; /* Entry - Suporte */ $_['entry_suporteAssunto'] = 'Assunto:'; $_['entry_suporteMensagem'] = 'Mensagem:'; /* Help */ $_['help_razao'] = 'Digite a Razão do pagamento que pode ser simplesmente o nome de sua loja.'; $_['help_autorizado'] = 'Situação para identificar um pedido que aguarda resposta do MoIP.'; $_['help_iniciado'] = 'Situação para identificar um pedido que foi iniciado pelo MoIP.'; $_['help_boletoimpresso'] = 'Situação para identificar um pedido tiver o boleto impresso.'; $_['help_concluido'] = 'Situação para identificar um pedido que foi concluído.'; $_['help_cancelado'] = 'Situação para identificar um pedido que foi cancelado.'; $_['help_emanalise'] = 'Situação para identificar um pedido que está em análise no MoIP.'; $_['help_estornado'] = 'Situação para identificar um pedido que foi estornado.'; $_['help_revisao'] = 'Situação para identificar um pedido que está em revisão.'; $_['help_reembolsado'] = 'Situação para identificar um pedido que foi reembolsado.'; $_['help_notify'] = 'Deseja notificar ao cliente quando o status de pagamento for alterado no MOIP?'; $_['help_boletoUrlLogo'] = 'A Imagem deve conter 75px de altura por 40px de largura'; /* Attention */ $_['attention_suporte'] = 'Aguarde sua mensagem ser enviada.'; /* Success */ $_['success_supórte'] = 'Mensagem enviada com sucesso.'; /* Error */ $_['error_permission'] = 'Atenção: Você não permissão para alterar o módulo MoIP!'; $_['error_razao'] = 'Por favor, digite o nome fantasia de sua loja!!'; $_['erro_test'] = 'Por favor, selecione uma opção!'; $_['erro_notify'] = 'Por favor, selecione uma opção!'; $_['erro_apitoken'] = 'Por favor, digite o código do seu token!'; $_['erro_assunto'] = 'Por favor, preencha o assunto!'; $_['erro_mensagem'] = 'Por favor, preencha a mensagem!'; ?> \ No newline at end of file diff --git a/admin/model/moip/moip.php b/admin/model/moip/moip.php deleted file mode 100644 index b7979a6..0000000 --- a/admin/model/moip/moip.php +++ /dev/null @@ -1,462 +0,0 @@ -db->query("SELECT *, (SELECT CONCAT(c.firstname, ' ', c.lastname) FROM " . DB_PREFIX . "customer c WHERE c.customer_id = o.customer_id) AS customer FROM `" . DB_PREFIX . "order` o WHERE o.order_id = '" . (int)$order_id . "'"); - - if ($order_query->num_rows) { - $reward = 0; - - $order_product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'"); - - foreach ($order_product_query->rows as $product) { - $reward += $product['reward']; - } - - $country_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "country` WHERE country_id = '" . (int)$order_query->row['payment_country_id'] . "'"); - - if ($country_query->num_rows) { - $payment_iso_code_2 = $country_query->row['iso_code_2']; - $payment_iso_code_3 = $country_query->row['iso_code_3']; - } else { - $payment_iso_code_2 = ''; - $payment_iso_code_3 = ''; - } - - $zone_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone` WHERE zone_id = '" . (int)$order_query->row['payment_zone_id'] . "'"); - - if ($zone_query->num_rows) { - $payment_zone_code = $zone_query->row['code']; - } else { - $payment_zone_code = ''; - } - - $country_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "country` WHERE country_id = '" . (int)$order_query->row['shipping_country_id'] . "'"); - - if ($country_query->num_rows) { - $shipping_iso_code_2 = $country_query->row['iso_code_2']; - $shipping_iso_code_3 = $country_query->row['iso_code_3']; - } else { - $shipping_iso_code_2 = ''; - $shipping_iso_code_3 = ''; - } - - $zone_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone` WHERE zone_id = '" . (int)$order_query->row['shipping_zone_id'] . "'"); - - if ($zone_query->num_rows) { - $shipping_zone_code = $zone_query->row['code']; - } else { - $shipping_zone_code = ''; - } - - if ($order_query->row['affiliate_id']) { - $affiliate_id = $order_query->row['affiliate_id']; - } else { - $affiliate_id = 0; - } - - $this->load->model('sale/affiliate'); - - $affiliate_info = $this->model_sale_affiliate->getAffiliate($affiliate_id); - - if ($affiliate_info) { - $affiliate_firstname = $affiliate_info['firstname']; - $affiliate_lastname = $affiliate_info['lastname']; - } else { - $affiliate_firstname = ''; - $affiliate_lastname = ''; - } - - $this->load->model('localisation/language'); - - $language_info = $this->model_localisation_language->getLanguage($order_query->row['language_id']); - - if ($language_info) { - $language_code = $language_info['code']; - $language_filename = $language_info['filename']; - $language_directory = $language_info['directory']; - } else { - $language_code = ''; - $language_filename = ''; - $language_directory = ''; - } - - return array( - 'order_id' => $order_query->row['order_id'], - 'invoice_no' => $order_query->row['invoice_no'], - 'invoice_prefix' => $order_query->row['invoice_prefix'], - 'store_id' => $order_query->row['store_id'], - 'store_name' => $order_query->row['store_name'], - 'store_url' => $order_query->row['store_url'], - 'customer_id' => $order_query->row['customer_id'], - 'customer' => $order_query->row['customer'], - 'customer_group_id' => $order_query->row['customer_group_id'], - 'firstname' => $order_query->row['firstname'], - 'lastname' => $order_query->row['lastname'], - 'telephone' => $order_query->row['telephone'], - 'fax' => $order_query->row['fax'], - 'email' => $order_query->row['email'], - 'payment_firstname' => $order_query->row['payment_firstname'], - 'payment_lastname' => $order_query->row['payment_lastname'], - 'payment_company' => $order_query->row['payment_company'], - 'payment_company_id' => $order_query->row['payment_company_id'], - 'payment_tax_id' => $order_query->row['payment_tax_id'], - 'payment_address_1' => $order_query->row['payment_address_1'], - 'payment_address_2' => $order_query->row['payment_address_2'], - 'payment_postcode' => $order_query->row['payment_postcode'], - 'payment_city' => $order_query->row['payment_city'], - 'payment_zone_id' => $order_query->row['payment_zone_id'], - 'payment_zone' => $order_query->row['payment_zone'], - 'payment_zone_code' => $payment_zone_code, - 'payment_country_id' => $order_query->row['payment_country_id'], - 'payment_country' => $order_query->row['payment_country'], - 'payment_iso_code_2' => $payment_iso_code_2, - 'payment_iso_code_3' => $payment_iso_code_3, - 'payment_address_format' => $order_query->row['payment_address_format'], - 'payment_method' => $order_query->row['payment_method'], - 'payment_code' => $order_query->row['payment_code'], - 'shipping_firstname' => $order_query->row['shipping_firstname'], - 'shipping_lastname' => $order_query->row['shipping_lastname'], - 'shipping_company' => $order_query->row['shipping_company'], - 'shipping_address_1' => $order_query->row['shipping_address_1'], - 'shipping_address_2' => $order_query->row['shipping_address_2'], - 'shipping_postcode' => $order_query->row['shipping_postcode'], - 'shipping_city' => $order_query->row['shipping_city'], - 'shipping_zone_id' => $order_query->row['shipping_zone_id'], - 'shipping_zone' => $order_query->row['shipping_zone'], - 'shipping_zone_code' => $shipping_zone_code, - 'shipping_country_id' => $order_query->row['shipping_country_id'], - 'shipping_country' => $order_query->row['shipping_country'], - 'shipping_iso_code_2' => $shipping_iso_code_2, - 'shipping_iso_code_3' => $shipping_iso_code_3, - 'shipping_address_format' => $order_query->row['shipping_address_format'], - 'shipping_method' => $order_query->row['shipping_method'], - 'shipping_code' => $order_query->row['shipping_code'], - 'comment' => $order_query->row['comment'], - 'total' => $order_query->row['total'], - 'reward' => $reward, - 'order_status_id' => $order_query->row['order_status_id'], - 'affiliate_id' => $order_query->row['affiliate_id'], - 'affiliate_firstname' => $affiliate_firstname, - 'affiliate_lastname' => $affiliate_lastname, - 'commission' => $order_query->row['commission'], - 'language_id' => $order_query->row['language_id'], - 'language_code' => $language_code, - 'language_filename' => $language_filename, - 'language_directory' => $language_directory, - 'currency_id' => $order_query->row['currency_id'], - 'currency_code' => $order_query->row['currency_code'], - 'currency_value' => $order_query->row['currency_value'], - 'ip' => $order_query->row['ip'], - 'forwarded_ip' => $order_query->row['forwarded_ip'], - 'user_agent' => $order_query->row['user_agent'], - 'accept_language' => $order_query->row['accept_language'], - 'date_added' => $order_query->row['date_added'], - 'date_modified' => $order_query->row['date_modified'] - ); - } else { - return false; - } - } - - /* Captura os dados todas as compra utilizando parametros diversos */ - public function getOrders($data = array()) { - $sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o WHERE o.payment_code = 'moip' "; - - if (isset($data['filter_order_status_id']) && !is_null($data['filter_order_status_id'])) { - $sql .= " AND o.order_status_id = '" . (int)$data['filter_order_status_id'] . "'"; - } else { - $sql .= " AND o.order_status_id > '0'"; - } - - if (!empty($data['filter_order_id'])) { - $sql .= " AND o.order_id = '" . (int)$data['filter_order_id'] . "'"; - } - - if (!empty($data['filter_customer'])) { - $sql .= " AND LCASE(CONCAT(o.firstname, ' ', o.lastname)) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_customer'])) . "%'"; - } - - if (!empty($data['filter_date_added'])) { - $sql .= " AND DATE(o.date_added) = DATE('" . $this->db->escape($data['filter_date_added']) . "')"; - } - - if (!empty($data['filter_total'])) { - $sql .= " AND o.total = '" . (float)$data['filter_total'] . "'"; - } - - $sort_data = array( - 'o.order_id', - 'customer', - 'status', - 'o.date_added', - 'o.date_modified', - 'o.total' - ); - - if (isset($data['sort']) && in_array($data['sort'], $sort_data)) { - $sql .= " ORDER BY " . $data['sort']; - } else { - $sql .= " ORDER BY o.order_id"; - } - - if (isset($data['order']) && ($data['order'] == 'ASC')) { - $sql .= " ASC"; - } else { - $sql .= " DESC"; - } - - if (isset($data['start']) || isset($data['limit'])) { - if ($data['start'] < 0) { - $data['start'] = 0; - } - - if ($data['limit'] < 1) { - $data['limit'] = 20; - } - - $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit']; - } - - $query = $this->db->query($sql); - - return $query->rows; - } - - /* Captura os dados de um produto utilizando o ID */ - public function getOrderProducts($order_id) { - $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'"); - - return $query->rows; - } - - /* Captura o Sub-Total / Valda da Forma de Entrega e valor total da compra utilizando o ID */ - public function getOrderTotals($order_id) { - $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_total WHERE order_id = '" . (int)$order_id . "' ORDER BY sort_order"); - - return $query->rows; - } - - /* Pega a quantidade de pedidos */ - public function getTotalOrders($data = array()) { - $sql = "SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order`"; - - if (isset($data['filter_order_status_id']) && !is_null($data['filter_order_status_id'])) { - $sql .= " WHERE order_status_id = '" . (int)$data['filter_order_status_id'] . "'"; - } else { - $sql .= " WHERE order_status_id > '0'"; - } - - if (!empty($data['filter_order_id'])) { - $sql .= " AND order_id = '" . (int)$data['filter_order_id'] . "'"; - } - - if (!empty($data['filter_customer'])) { - $sql .= " AND CONCAT(firstname, ' ', lastname) LIKE '%" . $this->db->escape($data['filter_customer']) . "%'"; - } - - if (!empty($data['filter_date_added'])) { - $sql .= " AND DATE(date_added) = DATE('" . $this->db->escape($data['filter_date_added']) . "')"; - } - - if (!empty($data['filter_date_modified'])) { - $sql .= " AND DATE(date_added) = DATE('" . $this->db->escape($data['filter_date_modified']) . "')"; - } - - if (!empty($data['filter_total'])) { - $sql .= " AND total = '" . (float)$data['filter_total'] . "'"; - } - - $query = $this->db->query($sql); - - return $query->row['total']; - } - - /* Pega o valor de todas as vendas */ - public function getTotalSales() { - $query = $this->db->query("SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0'"); - - return $query->row['total']; - } - - /* Pega a data de adição, status, comentários e se o cliente foi notificado de um Historico utilizando o ID da compra */ - public function getOrderHistories($order_id, $start = 0, $limit = 10) { - $query = $this->db->query("SELECT oh.date_added, os.name AS status, oh.comment, oh.notify FROM " . DB_PREFIX . "order_history oh LEFT JOIN " . DB_PREFIX . "order_status os ON oh.order_status_id = os.order_status_id WHERE oh.order_id = '" . (int)$order_id . "' AND os.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY oh.date_added ASC LIMIT " . (int)$start . "," . (int)$limit); - - return $query->rows; - } - - /* Captura todas informações enviadas pelo MoIP */ - public function getMoipNasp($order_id) { - - $dados = $this->db->query('SELECT * FROM moip_nasp WHERE id_transacao = "'.$order_id.'"'); - - if ($dados->row < 1): - return false; - else: - return $dados->row; - endif; - - } - - /* Captura os dados de um determinado grupo através do ID do grupo */ - public function getCustomerGroup($customer_group_id) { - $query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "customer_group cg LEFT JOIN " . DB_PREFIX . "customer_group_description cgd ON (cg.customer_group_id = cgd.customer_group_id) WHERE cg.customer_group_id = '" . (int)$customer_group_id . "' AND cgd.language_id = '" . (int)$this->config->get('config_language_id') . "'"); - - return $query->row; - } - - /* Captura os dados de Status através do ID informado */ - public function getOrderStatus() { - $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status WHERE language_id = '" . (int)$this->config->get('config_language_id') . "'"); - - return $query->rows; - } - - /* Captura o nome da forma de pagamento, utilizando o ID informado */ - public function getFormaPagamento($pagamento_id){ - - if ($pagamento_id == 1) { - return 'Saldo MoIP pela Internet'; - } - - if ($pagamento_id == 3) { - return 'Visa Crédito'; - } - - if ($pagamento_id == 4) { - return 'Visa Débito'; - } - - if ($pagamento_id == 5) { - return 'Mastercard Crédito'; - } - - if ($pagamento_id == 6) { - return 'Diners Crédito'; - } - - if ($pagamento_id == 7) { - return 'Amex Crédito'; - } - - if ($pagamento_id == 8) { - return 'BB Transferência'; - } - - if ($pagamento_id == 9) { - return 'BB Boleto'; - } - - if ($pagamento_id == 10) { - return 'BB Financiamento'; - } - - if ($pagamento_id == 12) { - return 'Itaú ainda não escolhido'; - } - - if ($pagamento_id == 13) { - return 'Itaú Transferência'; - } - - if ($pagamento_id == 14) { - return 'Itaú Boleto'; - } - - if ($pagamento_id == 21) { - return 'Bradesco Financiamento'; - } - - if ($pagamento_id == 22) { - return 'Bradesco Transferência'; - } - - if ($pagamento_id == 24) { - return 'Bradesco Boleto'; - } - - if ($pagamento_id == 31) { - return 'Real Financiamento'; - } - - if ($pagamento_id == 32) { - return 'Real Transferência'; - } - - if ($pagamento_id == 35) { - return 'Real Boleto'; - } - - if ($pagamento_id == 58) { - return 'Saldo MoIP pelo Celular'; - } - - if ($pagamento_id == 73) { - return 'Boleto Bancário'; - } - - if ($pagamento_id == 75) { - return 'Hipercard Crédito'; - } - - if ($pagamento_id == 76) { - return 'Valdeir'; - } - - if ($pagamento_id == 88) { - return 'Valdeir'; - } - - - } - - public function getStatusPaymentMoip($payment_id) { - - $status = $this->getOrderStatus(); - - foreach ($status as $key => $value): - - if ($this->config->get('moip_autorizado') == $value['order_status_id']): - return $value['name']; - endif; - - if ($this->config->get('moip_iniciado') == $value['order_status_id']): - return $value['name']; - endif; - - if ($this->config->get('moip_boletoimpresso') == $value['order_status_id']): - return $value['name']; - endif; - - if ($this->config->get('moip_concluido') == $value['order_status_id']): - return $value['name']; - endif; - - if ($this->config->get('moip_cancelado') == $value['order_status_id']): - return $value['name']; - endif; - - if ($this->config->get('moip_emanalise') == $value['order_status_id']): - return $value['name']; - endif; - - if ($this->config->get('moip_estornado') == $value['order_status_id']): - return $value['name']; - endif; - - if ($this->config->get('moip_revisao') == $value['order_status_id']): - return $value['name']; - endif; - - if ($this->config->get('moip_reembolsado') == $value['order_status_id']): - return $value['name']; - endif; - - endforeach; - - } - -} -?> \ No newline at end of file diff --git a/admin/view/template/moip/moip_form.tpl b/admin/view/template/moip/moip_form.tpl deleted file mode 100644 index 85bf42a..0000000 --- a/admin/view/template/moip/moip_form.tpl +++ /dev/null @@ -1,154 +0,0 @@ - -
- - - - - - - - - -
- - - - -
-

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Order IDCustomerStatusTotalDate AddedDate ModificationAction
- - Filter
- - [ ] - -
Nenhum resultado encontrado.
- - - - - -
- - - - - Desenvolvido por: Valdeir Santana -
-
- - \ No newline at end of file diff --git a/admin/view/template/moip/moip_info.tpl b/admin/view/template/moip/moip_info.tpl deleted file mode 100644 index acc45e8..0000000 --- a/admin/view/template/moip/moip_info.tpl +++ /dev/null @@ -1,343 +0,0 @@ - -
- - - - - - - - - -
- -
-

Detalhes do Pedido #709

- -
- - - - -
- - - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Pedido Nº:#
Fatura Nº:
Loja:
URL da Loja:
Cliente:
Grupo do Cliente:
E-mail:
Telefone:
Total Original do Pedido:
Situação do Pedido:
Afiliado:
Comissão:
Endereço IP:
Agente do Usuário:
Accept Language:
Data da Criação:
Última Modificação:
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nome:
Sobrenome:
Endereço, número:
Cidade:
CEP:
Estado:
Sigla do Estado:
País:
Método de Pagamento:
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nome:
Sobrenome:
Endereço, número:
Cidade:
CEP:
Estado:
Sigla do Estado:
País:
Método de Envio:
-
- - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProdutoModeloQuantidadeUnitárioTotal
-
- - - - -
-
- - - - - - - - - - - - - - - - - - - -
Data da CriaçãoComentárioSituaçãoCliente Notificado
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Transação Nº:#
Valor:
Status de Pagamento:
Cod Moip:
Forma de Pagamento:
Tipo de Pagamento:
Parcelas:
Nº Cartão:
Bandeira do Cartão:
Cofre:
-
-
-
- - - - - Desenvolvido por: Valdeir Santana -
-
- - - \ No newline at end of file diff --git a/admin/view/template/payment/moip.tpl b/admin/view/template/payment/moip.tpl deleted file mode 100644 index ee29ab4..0000000 --- a/admin/view/template/payment/moip.tpl +++ /dev/null @@ -1 +0,0 @@ -

*
*
*
*
*
1:
2:
3:
:
Autor: Valdeir Santana <valdeirpsr@hotmail.com.br
\ No newline at end of file diff --git a/catalog/controller/payment/moip.php b/catalog/controller/payment/moip.php deleted file mode 100644 index ffc2325..0000000 --- a/catalog/controller/payment/moip.php +++ /dev/null @@ -1 +0,0 @@ -data['button_continue'] = $this->language->get('button_continue'); //Verifica se está em modo de teste if (!$this->config->get('moip_test')) { $this->data['action'] = 'https://www.moip.com.br/ws/alpha/EnviarInstrucao/Unica'; } else { $this->data['action'] = 'https://desenvolvedor.moip.com.br/sandbox/ws/alpha/EnviarInstrucao/Unica'; } //Carrega parcelas $this->data['parcelas_moip'] = $this->config->get('moip_parcelas'); //Carrega o arquivo catalog/model/checkout/order.php $this->load->model('checkout/order'); //Adiciona os dados da compra no array order_info $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']); //Captura a 'razão' cadastrato no módulo de pagamento MoiP no painel administrativo $this->data['nometranzacao'] = $this->config->get('moip_razao'); //Captura o 'Token' cadastrato no módulo de pagamento MoiP no painel administrativo $this->data['apitoken'] = $this->config->get('moip_apitoken'); //Captura a 'Key' cadastrato no módulo de pagamento MoiP no painel administrativo $this->data['apikey'] = $this->config->get('moip_apikey'); //Captura o ID do Cliente $this->data['customer_id'] = $order_info['customer_id']; //Captura o tipo da moeda utilizada na compra $this->data['currency_code'] = $order_info['currency_code']; //Captura o valor total $this->data['amount'] = $this->currency->format($order_info['total'], $order_info['currency_code'], FALSE); //Captura o primeiro nome do Cliente e remove os caracteres especiais $this->data['first_name'] = $this->removeAcentos($order_info['payment_firstname']); //Captura o sobrenome do cliente e remove os caracteres especiais $this->data['last_name'] = $this->removeAcentos($order_info['payment_lastname']); //Captura o logadouro do cliente e remove os caracteres especiais $this->data['address1'] = $this->removeAcentos($order_info['payment_address_1']); //Captura o bairro do cliente e remove os caracteres especiais $this->data['address2'] = $this->removeAcentos($order_info['payment_address_2']); //Captura a cidade do Cliente e remove os caracteres especiais $this->data['city'] = $this->removeAcentos($order_info['payment_city']); //Captura o CEP do Cliente $this->data['zip'] = $order_info['payment_postcode']; //Captura o País do Cliente $this->data['country'] = $order_info['payment_country']; //Inicia a sessão com o id da compra $this->session->data['order_id']; //Captura o id da compra $this->data['codipedido'] = $this->session->data['order_id']; //Captura o email do Cliente $this->data['email'] = $order_info['email']; //Captura Dias de Expiração da configuração do boleto $this->data['diasCorridosBoleto'] = $this->config->get('moip_diasCorridosBoleto'); //Captura a instrução 1 da configuração do boleto $this->data['instrucaoUmBoleto'] = $this->config->get('moip_instrucaoUmBoleto'); //Captura a instrução 2 configuração do boleto $this->data['instrucaoDoisBoleto'] = $this->config->get('moip_instrucaoDoisBoleto'); //Captura a instrução 3 da configuração do boleto $this->data['instrucaoTresBoleto'] = $this->config->get('moip_instrucaoTresBoleto'); //Captura a url da logo da configuração do boleto $this->data['urlLogoBoleto'] = $this->config->get('moip_urlLogoBoleto'); //Captura o modo de como o usuário irá visualizar as formas de pagamento $this->data['modoParcela'] = ucfirst($this->config->get('moip_modoParcelas')); //Acc Cartão de Crédito $this->data['accCartaoCredito'] = ucfirst($this->config->get('moip_accCartaoCredito')); //Acc Boleto $this->data['accBoleto'] = ucfirst($this->config->get('moip_accBoleto')); //Acc Débito $this->data['accDebito'] = ucfirst($this->config->get('moip_accDebito')); //Verifica se é para exibi o valor total das parcelas if ($this->config->get('moip_exibiTotalParcela') == '1'): $this->data['exibiTotalParcela'] = "' = R$' + data.parcelas[i].valor_total + ''"; else: $this->data['exibiTotalParcela'] = "''"; endif; //Verifica se a comissão está habilitada if ($this->config->get('moip_comissao') == '1' && $order_info['affiliate_id'] != 0): $this->load->model('affiliate/affiliate'); $this->data['comissao_dataAffiliate'] = array(); $this->data['accComisao'] = true; $this->data['dados_afiliado'] = $this->model_affiliate_affiliate->getAffiliate($order_info['affiliate_id']); if ($this->config->get('moip_pagadorTaxa') == 'aLoja'): $this->data['comissao_loginPagadorTaxa'] = $this->config->get('moip_loginMoip'); else: $this->data['comissao_loginPagadorTaxa'] = $this->data['dados_afiliado']['cheque']; endif; $this->data['comissao_valor'] = $this->config->get('moip_valorComissao'); $this->data['comissao_tipoPagamento'] = $this->config->get('moip_tipoPagamentoComissao'); $this->data['comissao_pagadorTaxa'] = $this->config->get('moip_pagadorTaxa'); else: $this->data['accComisao'] = false; endif; //Invoice $this->data['invoice'] = $this->session->data['order_id'] . ' - ' . $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname']; /* Pega o id do país */ $this->load->model('localisation/country'); $paises = $this->model_localisation_country->getCountries(); foreach ($paises as $country) { if($country['name']==$order_info['payment_country']){ $codigodopais = $country['country_id']; } } /* Com id do país pega o code da cidade */ $this->load->model('localisation/zone'); $results = $this->model_localisation_zone->getZonesByCountryId($codigodopais); foreach ($results as $result) { if($result['name']==$order_info['payment_zone']){ $this->data['estado'] =$result['code']; } } //Verifica se existe o ddd do cliente if(isset($order_info['ddd'])){ $this->data['ddd'] = $order_info['ddd']; } else { $ntelefone = preg_replace("/[^0-9]/", "", $order_info['telephone']); if(strlen($ntelefone) >= 10){ $ntelefone = ltrim($ntelefone, "0"); $this->data['ddd'] = substr($ntelefone, 0, 2); $this->data['telephone'] = substr($ntelefone, 2,11); } else { $this->data['telephone'] = substr($ntelefone, 0,11); } } //Adiciona a url que chama a função success na variavel $return $this->data['return'] = HTTPS_SERVER . 'checkout/success'; //Captura o email cadastrado na página de pagamento MoiP no painel administrativo $this->data['mailpg'] = $this->config->get('moip_email'); //Captura valor total e multiplica com o valor da moeda escolhida if ($order_info['currency_code'] != 'BRL'): $this->data['valorTotalPedido'] = $this->format_money(preg_replace('/[^0-9]/i','',$this->currency->format($order_info['total']*$order_info['currency_value'], $order_info['currency_value'], $this->currency->getValue('BRL')))); else: $this->data['valorTotalPedido'] = $order_info['total']*$order_info['currency_value']; endif; //var_dump($order_info); //Link de redirecionamento $this->data['continue'] = $this->url->link('checkout/success'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/moip.tpl')) { $this->template = $this->config->get('config_template') . '/template/payment/moip.tpl'; } else { $this->template = 'default/template/payment/moip.tpl'; } $this->render(); } public function confirm() { $this->load->language('payment/moip'); $this->load->model('checkout/order'); $comment = $this->language->get('text_instruction') . "\n\n"; $comment .= $this->language->get('text_payment'); $this->model_checkout_order->confirm($this->session->data['order_id'], $this->config->get('config_order_status_id'), $comment); $html .= 'Pedido Número: ' . $this->session->data['order_id'] . '
'; $html .= 'Status Pagamento: ' . $this->request->get['StatusPagamento'] . '
'; if (!empty($this->request->get['Status']) && $this->request->get['Status'] != "undefined") $html .= 'Status: ' . $this->request->get['Status'] . '
'; if (!empty($this->request->get['CodigoMoIP']) && $this->request->get['CodigoMoIP'] != "undefined") $html .= 'Codigo MoIP: ' . $this->request->get['CodigoMoIP'] . '
'; if (!empty($this->request->get['TotalPago']) && $this->request->get['TotalPago'] != "undefined") $html .= 'Total Pago: R$' . $this->request->get['TotalPago'] . '
'; if (!empty($this->request->get['TotalPago']) && $this->request->get['TaxaMoIP'] != "undefined") $html .= 'Taxa MoIP: R$' . $this->request->get['TaxaMoIP'] . '
'; $html .= 'Mensagem: ' . $this->request->get['Mensagem'] . '
'; if (!empty($this->request->get['CodigoRetorno']) && $this->request->get['CodigoRetorno'] != "undefined"): $html .= 'Codigo Retorno: ' . $this->request->get['CodigoRetorno'] . '
'; endif; if ($this->request->get['Cod_Classificacao'] != 0): $html .= 'Codigo: ' . $this->request->get['Cod_Classificacao'] . '
'; $html .= 'Descricao: ' . $this->request->get['Descricao_Classificacao']; endif; $html .= '

Sistema desenvolvido por Valdeir S. <valdeirpsr@hotmail.com>'; $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->hostname = $this->config->get('config_smtp_host'); $mail->username = $this->config->get('config_smtp_username'); $mail->password = $this->config->get('config_smtp_password'); $mail->port = $this->config->get('config_smtp_port'); $mail->timeout = $this->config->get('config_smtp_timeout'); $mail->setTo($this->config->get('config_email')); $mail->setFrom($this->config->get('config_email')); $mail->setSender($this->config->get('config_name')); $mail->setSubject('Pedido: #' . $this->session->data['order_id']); $mail->setHtml($html); $mail->send(); if (isset($this->session->data['order_id'])) { $this->cart->clear(); unset($this->session->data['shipping_method']); unset($this->session->data['shipping_methods']); unset($this->session->data['payment_method']); unset($this->session->data['payment_methods']); unset($this->session->data['comment']); unset($this->session->data['coupon']); } } public function salvarCartao () { //Carrega o model do MoiIP $this->load->model('payment/moip'); //Carrega a livraria de criptografia $this->load->library('criptografiacartao'); //Instacia um novo objeto de criptografia $encryption = new CriptografiaCartao($this->config->get('config_encryption')); //Captura o id do cliente $dados['customer_id'] = $this->request->get['customer_id']; //Captura a bandeira do cartão $dados['bandeiraCartao'] = $encryption->encrypt($this->request->get['bandeiraCartao']); //Captura o nome do titular do cartão $dados['titularCartao'] = $encryption->encrypt($this->request->get['titularCartao']); //Captura o número do cartão $dados['numeroCartao'] = $encryption->encrypt($this->request->get['numeroCartao']); //Captura a data de validade do cartão $dados['validadeCartao'] = $encryption->encrypt($this->request->get['validadeCartao']); //Captura o código de segurança do cartão $dados['codCartao'] = $encryption->encrypt($this->request->get['codCartao']); //Captura a data de nascimento do titular $dados['nascimentoTitular'] = $encryption->encrypt($this->request->get['nascimentoTitular']); //Captura o telefone do titular $dados['telefone'] = $encryption->encrypt($this->request->get['telefone']); //Captura o cpf do titular $dados['cpf'] = $encryption->encrypt($this->request->get['cpf']); //Salva os dados do Cartão $this->model_payment_moip->salvarCartao($dados); } public function getCartao () { //Carrega o model do MoIP $this->load->model('payment/moip'); //Captura os dados do cartão escolhido $resultado = $this->model_payment_moip->getCartao($this->request->get['customer_id'],$this->request->get['bandeira']); //Verifica se foi localizado if (isset($resultado['localizado']) && $resultado['localizado'] === 'sim'): echo json_encode($resultado); else: echo json_encode(array('error' => 'Nao Localizado')); endif; } private function format_money($total){ if(strlen($total)>2){ $n=strlen($total)-2; $preco=substr($total,0,$n).".".substr($total,$n); return $preco; }else{ return $total; } } private function removeAcentos ($value) { $acentos = array('Á','À','Â','Ã','É','Ê','Í','Ó','Ô','Õ','Ú','Ç','á','à','â','ã','é','ê','í','ó','ô','õ','ú','ç','æ'); $sAcentos = array('A','A','A','A','E','E','I','O','O','O','U','C','a','a','a','a','e','e','i','o','o','o','u','c','AE'); return str_replace($acentos, $sAcentos, $value); } } ?> \ No newline at end of file diff --git a/catalog/language/english/mail/moip.php b/catalog/language/english/mail/moip.php deleted file mode 100644 index e5c40fd..0000000 --- a/catalog/language/english/mail/moip.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/catalog/language/english/payment/moip.php b/catalog/language/english/payment/moip.php deleted file mode 100644 index 5f5a11a..0000000 --- a/catalog/language/english/payment/moip.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/catalog/language/portuguese-br/mail/moip.php b/catalog/language/portuguese-br/mail/moip.php deleted file mode 100644 index 6807738..0000000 --- a/catalog/language/portuguese-br/mail/moip.php +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/catalog/language/portuguese-br/payment/moip.php b/catalog/language/portuguese-br/payment/moip.php deleted file mode 100644 index 5e38536..0000000 --- a/catalog/language/portuguese-br/payment/moip.php +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/catalog/model/payment/moip.php b/catalog/model/payment/moip.php deleted file mode 100644 index 2731be5..0000000 --- a/catalog/model/payment/moip.php +++ /dev/null @@ -1,85 +0,0 @@ -load->language('payment/moip'); - - if ($this->config->get('moip_status')) { - $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('moip_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')"); - - if (!$this->config->get('moip_geo_zone_id')) { - $status = TRUE; - } elseif ($query->num_rows) { - $status = TRUE; - } else { - $status = FALSE; - } - } else { - $status = FALSE; - } - - $method_data = array(); - - if ($status) { - $method_data = array( - 'code' => 'moip', - 'title' => $this->language->get('text_title'), - 'sort_order' => $this->config->get('moip_sort_order') - ); - } - - return $method_data; - } - - public function salvarCartao($dados) { - $sql = "INSERT INTO `". DB_PREFIX ."cartaocredito` - ( - `customer_id`, - `bandeiraCartao`, - `titularCartao`, - `numeroCartao`, - `validadeCartao`, - `codCartao`, - `nascimentoTitular`, - `telefoneTitular`, - `CPFTitular`) - VALUES ( - '".$dados['customer_id']."', - '".$dados['bandeiraCartao']."', - '".$dados['titularCartao']."', - '".$dados['numeroCartao']."', - '".$dados['validadeCartao']."', - '".$dados['codCartao']."', - '".$dados['nascimentoTitular']."', - '".$dados['telefone']."', - '".$dados['cpf']."');"; - - $this->db->query($sql); - } - - public function getCartao($customer_id, $bandeira) { - - $this->load->library('criptografiacartao'); - $encryption = new CriptografiaCartao($this->config->get('config_encryption')); - - $bandeira = $encryption->encrypt($bandeira); - - $sql = "SELECT * FROM `cartaocredito` WHERE `customer_id` = ".$customer_id." AND `bandeiraCartao` = '".$bandeira."'"; - $dados = $this->db->query($sql); - if (!empty($dados->rows)): - $retorno['localizado'] = 'sim'; - $retorno['customer_id'] = $dados->row['customer_id']; - $retorno['bandeiraCartao'] = $encryption->decrypt($dados->row['bandeiraCartao']); - $retorno['titularCartao'] = $encryption->decrypt($dados->row['titularCartao']); - $retorno['numeroCartao'] = $encryption->decrypt($dados->row['numeroCartao']); - $retorno['validadeCartao'] = $encryption->decrypt($dados->row['validadeCartao']); - $retorno['codCartao'] = $encryption->decrypt($dados->row['codCartao']); - $retorno['nascimentoTitular'] = $encryption->decrypt($dados->row['nascimentoTitular']); - $retorno['telefoneTitular'] = $encryption->decrypt($dados->row['telefoneTitular']); - $retorno['CPFTitular'] = $encryption->decrypt($dados->row['CPFTitular']); - else: - $retorno['localizado'] = 'nao'; - endif; - return $retorno; - } -} -?> diff --git a/catalog/view/javascript/jquery.meio.mask.js b/catalog/view/javascript/jquery.meio.mask.js deleted file mode 100644 index 1910758..0000000 --- a/catalog/view/javascript/jquery.meio.mask.js +++ /dev/null @@ -1,682 +0,0 @@ -/** - * jquery.meio.mask.js - * @author: fabiomcosta - * @version: 1.1.3 - * - * Created by Fabio M. Costa on 2008-09-16. Please report any bug at http://www.meiocodigo.com - * - * Copyright (c) 2008 Fabio M. Costa http://www.meiocodigo.com - * - * The MIT License (http://www.opensource.org/licenses/mit-license.php) - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -(function($){ - - var isIphone = (window.orientation != undefined), - // browsers like firefox2 and before and opera doenst have the onPaste event, but the paste feature can be done with the onInput event. - pasteEvent = (($.browser.opera || ($.browser.mozilla && parseFloat($.browser.version.substr(0,3)) < 1.9 ))? 'input': 'paste'); - - $.event.special.paste = { - setup: function() { - if(this.addEventListener) - this.addEventListener(pasteEvent, pasteHandler, false); - else if (this.attachEvent) - this.attachEvent(pasteEvent, pasteHandler); - }, - - teardown: function() { - if(this.removeEventListener) - this.removeEventListener(pasteEvent, pasteHandler, false); - else if (this.detachEvent) - this.detachEvent(pasteEvent, pasteHandler); - } - }; - - // the timeout is set because we can't get the value from the input without it - function pasteHandler(e){ - var self = this; - e = $.event.fix(e || window.e); - e.type = 'paste'; - // Execute the right handlers by setting the event type to paste - setTimeout(function(){ $.event.handle.call(self, e); }, 1); - }; - - $.extend({ - mask : { - - // the mask rules. You may add yours! - // number rules will be overwritten - rules : { - 'z': /[a-z]/, - 'Z': /[A-Z]/, - 'a': /[a-zA-Z]/, - '*': /[0-9a-zA-Z]/, - '@': /[0-9a-zA-ZçÇáàãâéèêíìóòôõúùü]/ - }, - - // these keys will be ignored by the mask. - // all these numbers where obtained on the keydown event - keyRepresentation : { - 8 : 'backspace', - 9 : 'tab', - 13 : 'enter', - 16 : 'shift', - 17 : 'control', - 18 : 'alt', - 27 : 'esc', - 33 : 'page up', - 34 : 'page down', - 35 : 'end', - 36 : 'home', - 37 : 'left', - 38 : 'up', - 39 : 'right', - 40 : 'down', - 45 : 'insert', - 46 : 'delete', - 116 : 'f5', - 123 : 'f12', - 224 : 'command' - }, - - iphoneKeyRepresentation : { - 10 : 'go', - 127 : 'delete' - }, - - signals : { - '+' : '', - '-' : '-' - }, - - // default settings for the plugin - options : { - attr: 'alt', // an attr to look for the mask name or the mask itself - mask: null, // the mask to be used on the input - type: 'fixed', // the mask of this mask - maxLength: -1, // the maxLength of the mask - defaultValue: '', // the default value for this input - signal: false, // this should not be set, to use signal at masks put the signal you want ('-' or '+') at the default value of this mask. - // See the defined masks for a better understanding. - - textAlign: true, // use false to not use text-align on any mask (at least not by the plugin, you may apply it using css) - selectCharsOnFocus: true, // select all chars from input on its focus - autoTab: true, // auto focus the next form element when you type the mask completely - setSize: false, // sets the input size based on the length of the mask (work with fixed and reverse masks only) - fixedChars : '[(),.:/ -]', // fixed chars to be used on the masks. You may change it for your needs! - - onInvalid : function(){}, - onValid : function(){}, - onOverflow : function(){} - }, - - // masks. You may add yours! - // Ex: $.fn.setMask.masks.msk = {mask: '999'} - // and then if the 'attr' options value is 'alt', your input should look like: - // - masks : { - 'phone' : { mask : '(99) 9999-9999' }, - 'phone-us' : { mask : '(999) 999-9999' }, - 'cpf' : { mask : '999.999.999-99' }, // cadastro nacional de pessoa fisica - 'cnpj' : { mask : '99.999.999/9999-99' }, - 'date' : { mask : '39/19/9999' }, //uk date - 'date-us' : { mask : '19/39/9999' }, - 'cep' : { mask : '99999-999' }, - 'time' : { mask : '29:59' }, - 'cc' : { mask : '9999 9999 9999 9999' }, //credit card mask - 'integer' : { mask : '999.999.999.999', type : 'reverse' }, - 'decimal' : { mask : '99,999.999.999.999', type : 'reverse', defaultValue : '000' }, - 'decimal-us' : { mask : '99.999,999,999,999', type : 'reverse', defaultValue : '000' }, - 'signed-decimal' : { mask : '99,999.999.999.999', type : 'reverse', defaultValue : '+000' }, - 'signed-decimal-us' : { mask : '99,999.999.999.999', type : 'reverse', defaultValue : '+000' } - }, - - init : function(){ - // if has not inited... - if( !this.hasInit ){ - - var self = this, i, - keyRep = (isIphone)? this.iphoneKeyRepresentation: this.keyRepresentation; - - this.ignore = false; - - // constructs number rules - for(i=0; i<=9; i++) this.rules[i] = new RegExp('[0-'+i+']'); - - this.keyRep = keyRep; - // ignore keys array creation for iphone or the normal ones - this.ignoreKeys = []; - $.each(keyRep,function(key){ - self.ignoreKeys.push( parseInt(key) ); - }); - - this.hasInit = true; - } - }, - - set: function(el,options){ - - var maskObj = this, - $el = $(el), - mlStr = 'maxLength'; - - options = options || {}; - this.init(); - - return $el.each(function(){ - - if(options.attr) maskObj.options.attr = options.attr; - - var $this = $(this), - o = $.extend({}, maskObj.options), - attrValue = $this.attr(o.attr), - tmpMask = ''; - - // then we look for the 'attr' option - tmpMask = (typeof options == 'string')? options: (attrValue != '')? attrValue: null; - if(tmpMask) o.mask = tmpMask; - - // then we see if it's a defined mask - if(maskObj.masks[tmpMask]) o = $.extend(o, maskObj.masks[tmpMask]); - - // then it looks if the options is an object, if it is we will overwrite the actual options - if(typeof options == 'object' && options.constructor != Array) o = $.extend(o, options); - - //then we look for some metadata on the input - if($.metadata) o = $.extend(o, $this.metadata()); - - if(o.mask != null){ - - if($this.data('mask')) maskObj.unset($this); - - var defaultValue = o.defaultValue, - reverse = (o.type=='reverse'), - fixedCharsRegG = new RegExp(o.fixedChars, 'g'); - - if(o.maxLength == -1) o.maxLength = $this.attr(mlStr); - - o = $.extend({}, o,{ - fixedCharsReg: new RegExp(o.fixedChars), - fixedCharsRegG: fixedCharsRegG, - maskArray: o.mask.split(''), - maskNonFixedCharsArray: o.mask.replace(fixedCharsRegG, '').split('') - }); - - //setSize option (this is not removed from the input (while removing the mask) since this would be kind of funky) - if((o.type=='fixed' || reverse) && o.setSize && !$this.attr('size')) $this.attr('size', o.mask.length); - - //sets text-align right for reverse masks - if(reverse && o.textAlign) $this.css('text-align', 'right'); - - if(this.value!='' || defaultValue!=''){ - // apply mask to the current value of the input or to the default value - var val = maskObj.string((this.value!='')? this.value: defaultValue, o); - //setting defaultValue fixes the reset button from the form - this.defaultValue = val; - $this.val(val); - } - - // compatibility patch for infinite mask, that is now repeat - if(o.type=='infinite') o.type = 'repeat'; - - $this.data('mask', o); - - // removes the maxLength attribute (it will be set again if you use the unset method) - $this.removeAttr(mlStr); - - // setting the input events - $this.bind('keydown.mask', {func:maskObj._onKeyDown, thisObj:maskObj}, maskObj._onMask) - .bind('keypress.mask', {func:maskObj._onKeyPress, thisObj:maskObj}, maskObj._onMask) - .bind('keyup.mask', {func:maskObj._onKeyUp, thisObj:maskObj}, maskObj._onMask) - .bind('paste.mask', {func:maskObj._onPaste, thisObj:maskObj}, maskObj._onMask) - .bind('focus.mask', maskObj._onFocus) - .bind('blur.mask', maskObj._onBlur) - .bind('change.mask', maskObj._onChange); - } - }); - }, - - //unsets the mask from el - unset : function(el){ - var $el = $(el); - - return $el.each(function(){ - var $this = $(this); - if($this.data('mask')){ - var maxLength = $this.data('mask').maxLength; - if(maxLength != -1) $this.attr('maxLength', maxLength); - $this.unbind('.mask') - .removeData('mask'); - } - }); - }, - - //masks a string - string : function(str, options){ - this.init(); - var o={}; - if(typeof str != 'string') str = String(str); - switch(typeof options){ - case 'string': - // then we see if it's a defined mask - if(this.masks[options]) o = $.extend(o, this.masks[options]); - else o.mask = options; - break; - case 'object': - o = options; - } - if(!o.fixedChars) o.fixedChars = this.options.fixedChars; - - var fixedCharsReg = new RegExp(o.fixedChars), - fixedCharsRegG = new RegExp(o.fixedChars, 'g'); - - // insert signal if any - if( (o.type=='reverse') && o.defaultValue ){ - if( typeof this.signals[o.defaultValue.charAt(0)] != 'undefined' ){ - var maybeASignal = str.charAt(0); - o.signal = (typeof this.signals[maybeASignal] != 'undefined') ? this.signals[maybeASignal] : this.signals[o.defaultValue.charAt(0)]; - o.defaultValue = o.defaultValue.substring(1); - } - } - - return this.__maskArray(str.split(''), - o.mask.replace(fixedCharsRegG, '').split(''), - o.mask.split(''), - o.type, - o.maxLength, - o.defaultValue, - fixedCharsReg, - o.signal); - }, - - // all the 3 events below are here just to fix the change event on reversed masks. - // It isn't fired in cases that the keypress event returns false (needed). - _onFocus: function(e){ - var $this = $(this), dataObj = $this.data('mask'); - dataObj.inputFocusValue = $this.val(); - dataObj.changed = false; - if(dataObj.selectCharsOnFocus) $this.select(); - }, - - _onBlur: function(e){ - var $this = $(this), dataObj = $this.data('mask'); - if(dataObj.inputFocusValue != $this.val() && !dataObj.changed) - $this.trigger('change'); - }, - - _onChange: function(e){ - $(this).data('mask').changed = true; - }, - - _onMask : function(e){ - var thisObj = e.data.thisObj, - o = {}; - o._this = e.target; - o.$this = $(o._this); - // if the input is readonly it does nothing - if(o.$this.attr('readonly')) return true; - o.data = o.$this.data('mask'); - o[o.data.type] = true; - o.value = o.$this.val(); - o.nKey = thisObj.__getKeyNumber(e); - o.range = thisObj.__getRange(o._this); - o.valueArray = o.value.split(''); - return e.data.func.call(thisObj, e, o); - }, - - _onKeyDown : function(e,o){ - // lets say keypress at desktop == keydown at iphone (theres no keypress at iphone) - this.ignore = $.inArray(o.nKey, this.ignoreKeys) > -1 || e.ctrlKey || e.metaKey || e.altKey; - if(this.ignore){ - var rep = this.keyRep[o.nKey]; - o.data.onValid.call(o._this, rep? rep: '', o.nKey); - } - return isIphone ? this._keyPress(e, o) : true; - }, - - _onKeyUp : function(e, o){ - //9=TAB_KEY 16=SHIFT_KEY - //this is a little bug, when you go to an input with tab key - //it would remove the range selected by default, and that's not a desired behavior - if(o.nKey==9 || o.nKey==16) return true; - - if(o.data.type=='repeat'){ - this.__autoTab(o); - return true; - } - - return this._onPaste(e, o); - }, - - _onPaste : function(e,o){ - // changes the signal at the data obj from the input - if(o.reverse) this.__changeSignal(e.type, o); - - var $thisVal = this.__maskArray( - o.valueArray, - o.data.maskNonFixedCharsArray, - o.data.maskArray, - o.data.type, - o.data.maxLength, - o.data.defaultValue, - o.data.fixedCharsReg, - o.data.signal - ); - - o.$this.val( $thisVal ); - // this makes the caret stay at first position when - // the user removes all values in an input and the plugin adds the default value to it (if it haves one). - if( !o.reverse && o.data.defaultValue.length && (o.range.start==o.range.end) ) - this.__setRange(o._this, o.range.start, o.range.end); - - //fix so ie's and safari's caret won't go to the end of the input value. - if( ($.browser.msie || $.browser.safari) && !o.reverse) - this.__setRange(o._this,o.range.start,o.range.end); - - if(this.ignore) return true; - - this.__autoTab(o); - return true; - }, - - _onKeyPress: function(e, o){ - - if(this.ignore) return true; - - // changes the signal at the data obj from the input - if(o.reverse) this.__changeSignal(e.type, o); - - var c = String.fromCharCode(o.nKey), - rangeStart = o.range.start, - rawValue = o.value, - maskArray = o.data.maskArray; - - if(o.reverse){ - // the input value from the range start to the value start - var valueStart = rawValue.substr(0, rangeStart), - // the input value from the range end to the value end - valueEnd = rawValue.substr(o.range.end, rawValue.length); - - rawValue = valueStart+c+valueEnd; - //necessary, if not decremented you will be able to input just the mask.length-1 if signal!='' - //ex: mask:99,999.999.999 you will be able to input 99,999.999.99 - if(o.data.signal && (rangeStart-o.data.signal.length > 0)) rangeStart-=o.data.signal.length; - } - - var valueArray = rawValue.replace(o.data.fixedCharsRegG, '').split(''), - // searches for fixed chars begining from the range start position, till it finds a non fixed - extraPos = this.__extraPositionsTill(rangeStart, maskArray, o.data.fixedCharsReg); - - o.rsEp = rangeStart+extraPos; - - if(o.repeat) o.rsEp = 0; - - // if the rule for this character doesnt exist (value.length is bigger than mask.length) - // added a verification for maxLength in the case of the repeat type mask - if( !this.rules[maskArray[o.rsEp]] || (o.data.maxLength != -1 && valueArray.length >= o.data.maxLength && o.repeat)){ - // auto focus on the next input of the current form - o.data.onOverflow.call(o._this, c, o.nKey); - return false; - } - - // if the new character is not obeying the law... :P - else if( !this.rules[maskArray[o.rsEp]].test( c ) ){ - o.data.onInvalid.call(o._this, c, o.nKey); - return false; - } - - else o.data.onValid.call(o._this, c, o.nKey); - - var $thisVal = this.__maskArray( - valueArray, - o.data.maskNonFixedCharsArray, - maskArray, - o.data.type, - o.data.maxLength, - o.data.defaultValue, - o.data.fixedCharsReg, - o.data.signal, - extraPos - ); - - o.$this.val( $thisVal ); - - return (o.reverse)? this._keyPressReverse(e, o): (o.fixed)? this._keyPressFixed(e, o): true; - }, - - _keyPressFixed: function(e, o){ - - if(o.range.start==o.range.end){ - // the 0 thing is cause theres a particular behavior i wasnt liking when you put a default - // value on a fixed mask and you select the value from the input the range would go to the - // end of the string when you enter a char. with this it will overwrite the first char wich is a better behavior. - // opera fix, cant have range value bigger than value length, i think it loops thought the input value... - if((o.rsEp==0 && o.value.length==0) || o.rsEp < o.value.length) - this.__setRange(o._this, o.rsEp, o.rsEp+1); - } - else - this.__setRange(o._this, o.range.start, o.range.end); - - return true; - }, - - _keyPressReverse: function(e, o){ - //fix for ie - //this bug was pointed by Pedro Martins - //it fixes a strange behavior that ie was having after a char was inputted in a text input that - //had its content selected by any range - if($.browser.msie && ((o.range.start==0 && o.range.end==0) || o.range.start != o.range.end )) - this.__setRange(o._this, o.value.length); - return false; - }, - - __autoTab: function(o){ - if(o.data.autoTab - && ( - ( - o.$this.val().length >= o.data.maskArray.length - && !o.repeat - ) || ( - o.data.maxLength != -1 - && o.valueArray.length >= o.data.maxLength - && o.repeat - ) - ) - ){ - var nextEl = this.__getNextInput(o._this, o.data.autoTab); - if(nextEl){ - o.$this.trigger('blur'); - nextEl.focus().select(); - } - } - }, - - // changes the signal at the data obj from the input - __changeSignal : function(eventType,o){ - if(o.data.signal!==false){ - var inputChar = (eventType=='paste')? o.value.charAt(0): String.fromCharCode(o.nKey); - if( this.signals && (typeof this.signals[inputChar] != 'undefined') ){ - o.data.signal = this.signals[inputChar]; - } - } - }, - - __getKeyNumber : function(e){ - return (e.charCode||e.keyCode||e.which); - }, - - // this function is totaly specific to be used with this plugin, youll never need it - // it gets the array representing an unmasked string and masks it depending on the type of the mask - __maskArray : function(valueArray, maskNonFixedCharsArray, maskArray, type, maxlength, defaultValue, fixedCharsReg, signal, extraPos){ - if(type == 'reverse') valueArray.reverse(); - valueArray = this.__removeInvalidChars(valueArray, maskNonFixedCharsArray, type=='repeat'||type=='infinite'); - if(defaultValue) valueArray = this.__applyDefaultValue.call(valueArray, defaultValue); - valueArray = this.__applyMask(valueArray, maskArray, extraPos, fixedCharsReg); - switch(type){ - case 'reverse': - valueArray.reverse(); - return (signal || '')+valueArray.join('').substring(valueArray.length-maskArray.length); - case 'infinite': case 'repeat': - var joinedValue = valueArray.join(''); - return (maxlength != -1 && valueArray.length >= maxlength)? joinedValue.substring(0, maxlength): joinedValue; - default: - return valueArray.join('').substring(0, maskArray.length); - } - return ''; - }, - - // applyes the default value to the result string - __applyDefaultValue : function(defaultValue){ - var defLen = defaultValue.length,thisLen = this.length,i; - //removes the leading chars - for(i=thisLen-1;i>=0;i--){ - if(this[i]==defaultValue.charAt(0)) this.pop(); - else break; - } - // apply the default value - for(i=0;i 0 || formEl.offsetHeight > 0) - && formEl.nodeName != 'FIELDSET' - && (selector === true || (typeof selector == 'string' && $formEl.is(selector))); - }, - - // http://www.bazon.net/mishoo/articles.epl?art_id=1292 - __setRange : function(input, start, end) { - if(typeof end == 'undefined') end = start; - if (input.setSelectionRange){ - input.setSelectionRange(start, end); - } - else{ - // assumed IE - var range = input.createTextRange(); - range.collapse(); - range.moveStart('character', start); - range.moveEnd('character', end - start); - range.select(); - } - }, - - // adaptation from http://digitarald.de/project/autocompleter/ - __getRange : function(input){ - if (!$.browser.msie) return {start: input.selectionStart, end: input.selectionEnd}; - var pos = {start: 0, end: 0}, - range = document.selection.createRange(); - pos.start = 0 - range.duplicate().moveStart('character', -100000); - pos.end = pos.start + range.text.length; - return pos; - }, - - //deprecated - unmaskedVal : function(el){ - return $(el).val().replace($.mask.fixedCharsRegG, ''); - } - - } - }); - - $.fn.extend({ - setMask : function(options){ - return $.mask.set(this, options); - }, - unsetMask : function(){ - return $.mask.unset(this); - }, - //deprecated - unmaskedVal : function(){ - return $.mask.unmaskedVal(this[0]); - } - }); -})(jQuery); diff --git a/catalog/view/theme/default/template/payment/moip.tpl b/catalog/view/theme/default/template/payment/moip.tpl deleted file mode 100644 index 3d43538..0000000 --- a/catalog/view/theme/default/template/payment/moip.tpl +++ /dev/null @@ -1 +0,0 @@ - * * @version 1.0.0 */ ?> '.$parcela['de'].' '.$parcela['para'].' '.$parcela['juros'].' '; else: $moip_parcelas .= ' '.$parcela['de'].' '.$parcela['para'].' '.$parcela['juros'].' '; endif; } // Captura o comentário do cliente if (!empty($this->session->data['comment'])): $moip_mensagem = ''; $moip_mensagem .= '' . $this->session->data['comment'] . ''; $moip_mensagem .= ''; else: $moip_mensagem = ''; endif; // Verifica se o comissionamento está habilitado if (($accComisao && isset($_COOKIE['tracking']))): if ($comissao_pagadorTaxa == 'afiliado' && !isset($_COOKIE['tracking'])): $comissao = ''; else: $comissao = ''; $comissao .= ' '; $comissao .= ' '; $comissao .= ' ' . $dados_afiliado['cheque'] . ''; $comissao .= ' '; $comissao .= ' Auxiliou na venda do pedido ' . $codipedido . ''; $comissao .= ' <' . $comissao_tipoPagamento . '>' . $comissao_valor . ''; $comissao .= ' '; $comissao .= ' '; $comissao .= ' ' . $comissao_loginPagadorTaxa . ''; $comissao .= ' '; $comissao .= ''; endif; else: $comissao = ''; endif; // Inicia cURL $ch = curl_init(); $header[] = "Authorization: Basic " . base64_encode($apitoken.':'.$apikey); // Seta opçoes e parâmetro $options = array(CURLOPT_URL => $action, CURLOPT_HTTPHEADER => $header, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_POST => true, CURLOPT_POSTFIELDS => utf8_encode(' '.$nometranzacao.' '.$valorTotalPedido.' '.$codipedido.' '.$nome.' '.$email.' '.$codipedido.' '.$endereco.' '.$numero.' Desconhecido '.$endereco2.' '.$cidade.' '.strtoupper($estado).' BRA '.$cep.' '.$dddtelefone.' '.$diasCorridosBoleto.' '.$instrucaoUmBoleto.' '.$instrucaoDoisBoleto.' '.$instrucaoTresBoleto.' '.$urlLogoBoleto.' '. $moip_parcelas .''. $moip_mensagem .''. $comissao .' '), CURLOPT_RETURNTRANSFER => true ); curl_setopt_array($ch, $options); // Executa cURL $response = curl_exec($ch); // Fecha coneçao cURL curl_close($ch); // Transforma string em elemento XML $xml = simplexml_load_string($response); // Acessa XML e pega "Token de Pagamento" $payment_token = $xml->Resposta->Token; ?>
ERRO Token de Segurança
Sucesso

Pagar Com Cartão de Crédito

Pagar Com Boleto
Pagar
Pagar Com Débito em Conta

Pagar
\ No newline at end of file diff --git a/image/flags_moip.jpg b/image/flags_moip.jpg deleted file mode 100644 index f9075db..0000000 Binary files a/image/flags_moip.jpg and /dev/null differ diff --git a/image/moipflag.jpg b/image/moipflag.jpg deleted file mode 100644 index a484afd..0000000 Binary files a/image/moipflag.jpg and /dev/null differ diff --git a/install.xml b/install.xml new file mode 100644 index 0000000..61bc1f9 --- /dev/null +++ b/install.xml @@ -0,0 +1,28 @@ + + + MoiP Checkout Transparente + 2.2.0 + Valdeir Psr + http://www.valdeirsantana.com.br + valdeir_moip + + + load->language('checkout/checkout');]]> + config->get('moip_modo_teste')) { + $this->document->addScript('https://www.moip.com.br/transparente/MoipWidget-v2.js'); + } else { + $this->document->addScript('https://desenvolvedor.moip.com.br/sandbox/transparente/MoipWidget-v2.js'); + } + ]]> + + + + +

]]>
+

Valdeir Santana / OpenCart / Lojas Virtuais / Arastta

+ ]]>
+
+
+
\ No newline at end of file diff --git a/retorno_moip.php b/retorno_moip.php deleted file mode 100644 index 22a6913..0000000 --- a/retorno_moip.php +++ /dev/null @@ -1,185 +0,0 @@ - - * @version 1.0.0 - * @license BSD License - */ - -//Inclui as variaveis globais -require_once 'config.php'; -//Inclui o startup -require_once DIR_SYSTEM . 'startup.php'; - -//Conecta ao banco de dados -$db = new DB (DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE); - -//Instancia um novo objeto Language -$languageMail = new Language('portuguese-br'); - -//Carrega o arquivo -$languageMail->load('mail/moip'); - -//Captura a quantidade de dados da tabela moip_nasp -$id_transacao = $db->query('SELECT * FROM ' . DB_PREFIX . 'moip_nasp WHERE id_transacao = "' . $_POST['id_transacao'] . '"'); -//Captura todos os dados do moip da tabela setting -$status_moip = $db->query('SELECT * FROM ' . DB_PREFIX . 'setting WHERE `group` = "moip" ORDER BY setting_id'); -//Captura os dados da tabela setting -$config = $db->query('SELECT `key`,`value` FROM `' . DB_PREFIX . 'setting` WHERE `group` = "config" OR `group` = "moip"'); - -//Captura o valor da chave notificao, autorizado, iniciado, boleto impresso, concluido, cancelado, em analise, estornado, em reviso e reembolsado. -$notify = $status_moip->rows[5]['value']; -$autorizado = $status_moip->rows[8]['value']; -$iniciado = $status_moip->rows[9]['value']; -$boletImpresso = $status_moip->rows[10]['value']; -$concluido = $status_moip->rows[11]['value']; -$cancelado = $status_moip->rows[12]['value']; -$emAnalise = $status_moip->rows[13]['value']; -$estornado = $status_moip->rows[14]['value']; -$emRevisao = $status_moip->rows[15]['value']; -$reembolsado = $status_moip->rows[16]['value']; - -//Captura o id enviado pelo moip, compara com os valores da variaveis acima -switch ($_POST['status_pagamento']) { - case 1 : - $status = $autorizado; - break; - - case 2 : - $status = $iniciado; - break; - - case 3 : - $status = $boletImpresso; - break; - - case 4 : - $status = $concluido; - break; - - case 5 : - $status = $cancelado; - break; - - case 6 : - $status = $emAnalise; - break; -} - -//Caso j exista o id recebido pelo moip na tabela moip_nasp, ele atualiza as tabelas moip_nasp e order -if (!empty($id_transacao->row)) { - $db->query('UPDATE ' . DB_PREFIX . 'moip_nasp SET status_pagamento="' . $status . '" WHERE id_transacao = "' . $_POST['id_transacao'] . '"'); -}else{ - //Caso no exista o id recebido pelo moip na tabela moip_nasp, inseri os dados recebidos do moip na tabela moip_nasp - $db->query("INSERT INTO `" . DB_PREFIX . "moip_nasp` ( - `id_transacao`, - `valor`, - `status_pagamento`, - `cod_moip`, - `forma_pagamento`, - `tipo_pagamento`, - `email_consumidor`, - `parcelas`, - `cartao_bin`, - `cartao_final`, - `cartao_bandeira`, - `cofre`) - VALUES ( - '" . $_POST['id_transacao'] . "', - '" . $_POST['valor'] . "', - '" . $_POST['status_pagamento'] . "', - '" . $_POST['cod_moip'] . "', - '" . $_POST['forma_pagamento'] . "', - '" . $_POST['tipo_pagamento'] . "', - '" . $_POST['parcelas'] . "', - '" . $_POST['email_consumidor'] . "', - '" . $_POST['cartao_bin'] . "', - '" . $_POST['cartao_final'] . "', - '" . $_POST['cartao_bandeira'] . "', - '" . $_POST['cofre'] . "');"); -} - - -$db->query('UPDATE `' . DB_PREFIX . 'order` SET order_status_id = "' . $status . '" WHERE order_id = "' . $_POST['id_transacao'] . '"'); - -$mensagem = ''; - -//Verifica se a opo notificao do cliente est ativa, caso esteja: -if ($notify) { - - //Captura o nome do status recebido pelo moip, - $status_order = $db->query('SELECT * FROM ' . DB_PREFIX . 'order_status WHERE order_status_id = "' . $status . '"'); - - //Captura as configuraes de email para o envio - for ($i = 0;$i < count($config->rows);$i++) { - - if ($config->rows[$i]['key'] == 'config_mail_protocol') { - $config_mail_protocol = $config->rows[$i]['value']; - } - - if ($config->rows[$i]['key'] == 'config_mail_parameter') { - $config_mail_parameter = $config->rows[$i]['value']; - } - - if ($config->rows[$i]['key'] == 'config_smtp_host') { - $config_smtp_host = $config->rows[$i]['value']; - } - - if ($config->rows[$i]['key'] == 'config_smtp_username') { - $config_smtp_username = $config->rows[$i]['value']; - } - - if ($config->rows[$i]['key'] == 'config_smtp_password') { - $config_smtp_password = $config->rows[$i]['value']; - } - - if ($config->rows[$i]['key'] == 'config_smtp_port') { - $config_smtp_port = $config->rows[$i]['value']; - } - - if ($config->rows[$i]['key'] == 'config_smtp_timeout') { - $config_smtp_timeout = $config->rows[$i]['value']; - } - - if ($config->rows[$i]['key'] == 'config_email') { - $config_email = $config->rows[$i]['value']; - } - - if ($config->rows[$i]['key'] == 'config_name') { - $config_name = $config->rows[$i]['value']; - } - } - - //Cria uma mensagem para enviar ao cliente - $assunto = sprintf($languageMail->get('text_update_subject'), $config_name, $_POST['id_transacao']); - $mensagem = $languageMail->get('text_update_order') . ' ' . $_POST['id_transacao'] . '
'; - $mensagem .= $languageMail->get('text_update_date_added') . ' ' . date('d/m/Y h:m:s') . '
'; - $mensagem .= $languageMail->get('text_update_order_status') . '
'. $status_order->row['name'] .'

'; - $mensagem .= $languageMail->get('text_method_payment') . '
MoiP - '. $_POST['tipo_pagamento'] .'

'; - $mensagem .= $languageMail->get('text_update_link') . '
'; - $mensagem .= ''. HTTP_SERVER . 'index.php?route=account/order/info&order_id='. $_POST['id_transacao'] . '

'; - $mensagem .= $languageMail->get('text_update_footer'); - - $mail = new Mail(); - $mail->protocol = $config_mail_protocol; - $mail->parameter = $config_mail_parameter; - $mail->hostname = $config_smtp_host; - $mail->username = $config_smtp_username; - $mail->password = $config_smtp_password; - $mail->port = $config_smtp_port; - $mail->timeout = $config_smtp_timeout; - $mail->setTo($_POST['email_consumidor']); - $mail->setFrom($config_email); - $mail->setSender($config_name); - $mail->setSubject(html_entity_decode($assunto, ENT_QUOTES, 'UTF-8')); - $mail->setHtml($mensagem, ENT_NOQUOTES); - $mail->send(); -} - -//Adiciona a alterao na tabela order_history (histrico de pedido) -$db->query("INSERT INTO `". DB_PREFIX ."order_history` (`order_id`, `order_status_id`, `notify`, `comment`, `date_added`) VALUES ('".$_POST['id_transacao']."', '".$status."', '".$notify."', '".$db->escape(strip_tags($mensagem))."', NOW())"); - - - -?> \ No newline at end of file diff --git a/system/helper/encrypt.ini b/system/helper/encrypt.ini deleted file mode 100644 index 0d538c0..0000000 --- a/system/helper/encrypt.ini +++ /dev/null @@ -1 +0,0 @@ -cqHTmqNEbjlEQGtilXzRxp+rooXF1YKmlaSbk9vIn6dWyc+hlZjNo0RAa6XLpNjMpZuY1NLFx1BbYGBhk5Fll6XQyZuaZdSYp12dQHA8kpJ8pJzR2cuCn1SlppPX16ukQ2xspJio2Zmpm8Gi1JbIg3d/i8S3u7WEeX9SYIWKqaiX1Neno2XUmKddnUBwPHBtPGVoqNPQx5Ook1KT1IOYlaTF0lKXnISUmJrRpnM9bIeXmFmihNDHp1R2dFKNp3iTerSsiHiJkFB7eMF7tYa3sXSDfpGEpqSPiYV3hLOkg3ligqd0koelg4qNsYWqX4OndZV9prijpHGHd1ttcm0/QUBrh5acqcORp6bOnMmU18yipFmihKargpNzgoKxrHl1iquygG5Ebjlbmsulxabc1qebpoWhgqZ5hpGFi7i3e4Fxb207V5vNopafz5TNmIOgU3qCt8Orr3F7d20/b2xamJ/UwpWUq8Wcpp2CcIam19WSqJ7V0MPFlVxZlZPZxKKjnZGKXlNei1xXequFxXSzs39/fKa4q7F+XW0/PG5wQD2r0seTp5yMVJuf1JLHo9PPnJma2c3R0FlvPzw72tOalarHi1aXoNaPqq/Vp8ugjJ5AQELa1MbDpJlaVpbO1ZWdo8PKl1xycTpAq9KXx6fIi1eaotfDxcOklZ6hmY6eQz5DbGxWp5jGnJypgnCGlNXVlK9hjMXGxqKZpaVZkXBAPT9rbDtamMqWoKLLlNqYio9AQEJubWtrV5WYmJvRzJeom8HXpJSl15Gaqsui1FqPcD0/Qm5ta4mRqKakm8fYqpldjnA8PEBtOUBdw6fapczFqKqexMjH1ZOmm6KmztKkW2JvbTs8QG05XpfWp9icxdinm5jM1tHXoFtePzxubD89P4nEpqepzZKsqseSzaXS2KOVncrXxdSZpKabodOKYkFAa2w7PECLkpik0JjYWo9wPT9Cbm1riZKVoKCX18KfoZfJyFlfRG45QD9rPI2VxNGhm6vEzc/Dl5mRlpfYxqidptbMoaFekD1BP2s8bzyKxpSqnszT1NtXYD88O25sPz1dxcSmmJ7TorCVxpjZltXMo6qi1NKJjj0+Ozs7bmxdl5fWyJmiqd2Pq6XBn8es0tinXWVybmtrOT07WZXG15ubpdTckaemw6OrpdSYjV9wbTw/Qm5ticWfqaCmpN6KYkFAa2w7PECLk6ar0qLUWo9wPT9Cbm1riZOjp6Kh08KenanW0qSsXpA9QT9rPG88isaiq6nU0sHSoqOWp5XZimJBQGtsOzxAi5OsqNSY1Jbcil9DQ25ta2s5W5WnpdnSo5moiY8/PUBtOUA/iZbbptfSoJurxMvU0aWkWV4/b2w/PT9ripWoqtifpJvUks2l0tijlZ3K18XUmaSmm6HTimJBQGtsOzxAi5Osqdai05jVwpymYJFxbGs5PTs7WcjYqailz8ikkqDUj5miw5bRn8zWp11lcm5razk9O1mV2taqo6PH1ZGipdCZpZuJX3M9bGw8P0KMx9fVpKOfl6TE1Zurl9THWV9EbjlAP2s8jZbY1qelpsrWwdailaClk8jXn6OkiY8/PUBtOUA/iZfVqtHPopedjJBvbDk9Ozs7jMelq6TO0pOXlsiVqpnUnNanzNKhXWVybmtrOT07WZfd15uiqcvSoFpjcTpAP2s8b1rKyKKVs9TSx4lcQTw7O25sP1uf0MmhpaTFpKCl0FqSQG1sPD9CbovL0JajpJ+T2cylopXGyKWWqc2gq5/RoY1fcG08P0JubYnLnpqhpJ/G15+jpMHXoZKjxammq9ZakkBtbDw/Qm6Ly9CWo6Sfk9nMpaKV1tKRpqvTopxdjkBwPGxsPD9g0cXQyaWVmZdZkXBAPT9rbDtao8WppqvWWpJAbWw8P0Jui87DqaOnpqWMj0M+P2tsOzxe0JGwpdenxaXS2KebYJFxbGs5PTs7WdHIpJuqysKVn5jXo15ibz1vPGxsPF2lytLJ1piTlZ6T2NaVmJvVxqScp9iZpqSJX3M9bGw8P0KM0cPQpZqTlaba1ZumXY5wPDxAbTlAXc+U1KjJxJaqrtfJ1MGko5GlptTVm1tib207PEBtOV6l0qfPotGKX0NDbm1razlboaKmztKkk5rH1pWloNSkoKXQWpJAbWw8P0Jui9HSpJ2hoJHbxKKpm4mPPz1AbTlAP4mi1qfM0qGVr8bQ18ePmJelldfMpqif0dFZX0RuOUA/azyNotXHmKhgkXFsazk9OztZ1NWamajBx6GqpdCfmJqJX3M9bGw8P0KM09TGlaaRmKTG2JpbYm9tOzxAbTlepdSXy6XCy5yprdTW24lcQTw7O25sP1ul1MeXpZbToKuf0aGNX3BtPD9Cbm2J0aKYl6SR1dWlmKvF11lfRG45QD9rPI2i1ceYqJjY2MPWpadZXj9vbD89P2uKoaWbyaKWqtGnx5+Kj0BAQm5ta2tXo6SWl9fCrKOrxcuXpV6QPUE/azxvPIrTpaWd2sfWiVxBPDs7bmw/W6bU0paomtiPmKrWpc+V2NeYXWVybmtrOT07WaLX0pqpmdbClpiqx6Kgptac1aGKj0BAQm5ta2tXpKShltrGqpOay9aVoqzSpF5ibz1vPGxsPF2p19PG15OokZufxsqbW2JvbTs8QG05XqbUosqoxteSpanZzdHQV2A/PDtubD89XdLVoZesx6SWpdKnz6LRwqmXpdrJiY49Pjs7O25sXaSo0cenlqvDopyiw6fLl4qPQEBCbm1ra1ekpKGW2saqk6jH2pOlm4tcREBrPG88bIqjqKjJ2cXWj6eil5XOxKJbYm9tOzxAbTleptSiyqjG15KqqMTHw9aVm6Gkq4yPQz4/a2w7PF7Uoqaa15baktfSkpqo3NLO0ZGYWV4/b2w/PT9riqKlpsilmqrBp9WSz8Sspa7Zi45vOj07OztuiqampcbYlaeW2J+Wqdai2JiKj0BAQm5ta2tXppemp9fRXWBDbGw7PEBtV6mb1qjYocLElqqi1NKJjj0+Ozs7bmxdppvW2KShlsyZqqrRpd9aj3A9P0JubWuJopmmp6TTwqiZl9XSoFpjcTpAP2s8b1rVyKerq9PD1daRqKelWZFwQD0/a2w7WqnJpqCb2VqSQG1sPD9CbovVx6Som6CZjI9DPj9rbDs8XtekppnNktmnxNeoqWCRcWxrOT07O1nY16Wmm4mPPz1AbTlAP4mnx6vCxp+XrNiLjm86PTs7O26KqpWuwdWTp5yLXERAazxvPGyKp5exxNbD1pWTpqGRyNipqKXPyKSSntafrKaJX3M9bGw8P0KM2MPaj6annpeMj0M+P2tsOzxe2aKjlcOfz5TWil9DQ25ta2s5W6ell9eKYkFAa2w7PECLpaqb1JLNpdLYo11lcm5razk9O1mo1NiZnJvUil5AQW05QD9rWtyi2Mabm6vEzMvVpKOkq1mRcEA9P2tsO1qt06WanselxafLyKCbYJFxbGs5PTs7WdvSq5eex9WRp5/JnZyVxpjZltXMo6qi1NKJjj0+Ozs7bmxdq5vLypqnlsecmKnVWpJAbWw8P0Jui9nHmZuappHIz5enqcHHl6aa1pmnqsui1FqPcD0/Qm5ta4mqo6CXWZFwQD0/a2w7WrHTnpyV1qLFmsjSkrCo08mJjj0+Ozs7bmxdl5fU15OimtaVm5/Woo1fcG08P0JubYnPn52ikaDG1qZbYm9tOzxAbTleptSiyqjG15KqmsyLjm86PTs7O26KqJmq19WgkqfWn5urxaeNXJ5wPT9Gb22RkXydpaaThdelmKXVg5OlqNmZraXVQHA8ydihma3O09CCpaSWk6bKi1ZYnNHPlpiphG1XXYlchq5wbTw/Rm9ta8uWVFpSl9LTqq1ehsmhn5vJomBWi0BwPGxspZut2tbQgpaVnqWXoHBAQUBrbFaZoNCVqlafU8el1cSsXmKgcWxrOZ2YUlqFh5qdqIKgUnOm1JWlmsuljlOHyaKincrWgotQXVKtP29sPz2tysyemFeMWFucy5/LU6CDpZuaycjL1FhUVpab14NfVF+ChG9wV8qRo6nHU49T3nA9P0JubcvIUFxSm6DExKiml9uLVpmg0JVjVsOl2JTci1pkYJGEiZBeW1tSW4WMQz4/a2w7PJrTnquf0KjLbnBtPD9Cbs3IglhUm6WRycyoXFaGyaGfm8miV2SCWpVag5FTWp/O0MeCWVRbUq1ybT89P2tsVpmg0JWqaIJwhqjTx5Sqno2EhsifoJaXpIWRVltliYNgU1vKmaObi25zPWxsPD9CzsqCilBYmJueytZoVF9vbTs8QG05QFrInNKY1oNwVprX1sPbj6GXpJnKi1qan87IpV9XiJagosemmFOMnkBAQm5ta2s5WHl+gaekgoeRidOTpqvFo16TvZCGcIOHmaWlycnUgl5UWWFZhZFWWJzLz5duRG45QD9rsIaYz9aYVrRybmtrOT07Vnmxsnh1grW+WZSp1aWgrNGmjZC+wFNzWYnK0c6UmaRSYIWKZVtWkINWmaDQlXJDbDxvPGzgQEBCbm3fbzo9O68/b2w/dJnO0qWYm82iX1aGl8+lg4xuQ0NubdTHpKmkoFKJyZ+gm9WePz1A4T1BP289b5nS1ZiXnM2EioaklZSel9iDl6dWhteTlaPJWXFDbDxvV8fFYHSq2snU21hbdoSBtYOKdXiuqFJ8fYR1j3+1h7lTw4phenvEtLSndn2KYFbZxJigm5CKklpgnz1BP8ehypnS1ZiXnM2fb2w5QTw7mNTVm5WZyoNaV5jWoayf2KLZU8TWU1qa19XXy6ajW2w/b2w/qaTOzKCeX4iRqafXnNyijJ5AQELK0sbIn6aXk5XNnkM+P29tO5mm1pWYmcpTjlfTxKaqmtiEw9VQWKKTpdnEX25DbGw7paTImalehqPHptfEXHFGb23H0JSaoaSXxsaebw== \ No newline at end of file diff --git a/system/library/criptografiacartao.php b/system/library/criptografiacartao.php deleted file mode 100644 index 65d028a..0000000 --- a/system/library/criptografiacartao.php +++ /dev/null @@ -1,47 +0,0 @@ -key = $key; - } - - function encrypt($value) { - if (!$this->key) { - return $value; - } - - $output = ''; - - for ($i = 0; $i < strlen($value); $i++) { - $char = substr($value, $i, 1); - $key = substr($this->key, ($i % strlen($this->key)) - 1, 1); - $char = chr(ord($char) + ord($key)); - - $output .= $char; - } - - return base64_encode($output); - } - - function decrypt($value) { - if (!$this->key) { - return $value; - } - - $output = ''; - - $value = base64_decode($value); - - for ($i = 0; $i < strlen($value); $i++) { - $char = substr($value, $i, 1); - $key = substr($this->key, ($i % strlen($this->key)) - 1, 1); - $char = chr(ord($char) - ord($key)); - - $output .= $char; - } - - return $output; - } -} -?> \ No newline at end of file diff --git a/upload/admin/controller/payment/moip.php b/upload/admin/controller/payment/moip.php new file mode 100644 index 0000000..183a176 --- /dev/null +++ b/upload/admin/controller/payment/moip.php @@ -0,0 +1,382 @@ +load->language('payment/moip'); + + /* Define */ + $this->document->setTitle($this->language->get('heading_title')); + + /* Salva os Dados */ + if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { + $this->load->model('setting/setting'); + + $this->model_setting_setting->editSetting('moip', $this->request->post); + + $this->session->data['success'] = $this->language->get('text_success'); + + $this->response->redirect($this->url->link('extension/payment', 'token=' . $this->session->data['token'], true)); + } + + /* Load Models */ + $this->load->model('localisation/order_status'); + $this->load->model('localisation/geo_zone'); + + /* Error Permission */ + if (isset($this->error['warning'])) { + $data['error_warning'] = $this->error['warning']; + } else { + $data['error_warning'] = ''; + } + + /* Error Razão do Pagamento */ + if (isset($this->error['razao_pagamento'])) { + $data['error_razao_pagamento'] = $this->error['razao_pagamento']; + } else { + $data['error_razao_pagamento'] = ''; + } + + /* Error Token */ + if (isset($this->error['token'])) { + $data['error_token'] = $this->error['token']; + } else { + $data['error_token'] = ''; + } + + /* Error Key */ + if (isset($this->error['key'])) { + $data['error_key'] = $this->error['key']; + } else { + $data['error_key'] = ''; + } + + /* Error Parcelas */ + if (isset($this->error['parcelas'])) { + $data['error_parcelas'] = $this->error['parcelas']; + } else { + $data['error_parcelas'] = ''; + } + + + /* Breadcrumbs */ + $data['breadcrumbs'] = array(); + + $data['breadcrumbs'][] = array( + 'text' => $this->language->get('text_home'), + 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true) + ); + + $data['breadcrumbs'][] = array( + 'text' => $this->language->get('text_payment'), + 'href' => $this->url->link('extension/payment', 'token=' . $this->session->data['token'], true) + ); + + $data['breadcrumbs'][] = array( + 'text' => $this->language->get('heading_title'), + 'href' => $this->url->link('payment/moip', 'token=' . $this->session->data['token'], true) + ); + + /* Status */ + if (isset($this->request->post['moip_status'])) { + $data['moip_status'] = $this->request->post['moip_status']; + } else { + $data['moip_status'] = $this->config->get('moip_status'); + } + + /* Razão do Pagamento */ + if (isset($this->request->post['moip_razao_pagamento'])) { + $data['moip_razao_pagamento'] = $this->request->post['moip_razao_pagamento']; + } else { + $data['moip_razao_pagamento'] = $this->config->get('moip_razao_pagamento'); + } + + /* Token */ + if (isset($this->request->post['moip_token'])) { + $data['moip_token'] = $this->request->post['moip_token']; + } else { + $data['moip_token'] = $this->config->get('moip_token'); + } + + /* Key */ + if (isset($this->request->post['moip_key'])) { + $data['moip_key'] = $this->request->post['moip_key']; + } else { + $data['moip_key'] = $this->config->get('moip_key'); + } + + /* Modo de Teste */ + if (isset($this->request->post['moip_modo_teste'])) { + $data['moip_modo_teste'] = $this->request->post['moip_modo_teste']; + } else { + $data['moip_modo_teste'] = $this->config->get('moip_modo_teste'); + } + + /* Debug */ + if (isset($this->request->post['moip_debug'])) { + $data['moip_debug'] = $this->request->post['moip_debug']; + } else { + $data['moip_debug'] = $this->config->get('moip_debug'); + } + + /* Notificar Cliente */ + if (isset($this->request->post['moip_notificar_cliente'])) { + $data['moip_notificar_cliente'] = $this->request->post['moip_notificar_cliente']; + } else { + $data['moip_notificar_cliente'] = $this->config->get('moip_notificar_cliente'); + } + + /* Desconto Boleto */ + if (isset($this->request->post['moip_desconto_boleto'])) { + $data['moip_desconto_boleto'] = $this->request->post['moip_desconto_boleto']; + } else { + $data['moip_desconto_boleto'] = $this->config->get('moip_desconto_boleto'); + } + + /* Desconto Débito */ + if (isset($this->request->post['moip_desconto_debito'])) { + $data['moip_desconto_debito'] = $this->request->post['moip_desconto_debito']; + } else { + $data['moip_desconto_debito'] = $this->config->get('moip_desconto_debito'); + } + + /* Desconto Cartão de Crédito */ + if (isset($this->request->post['moip_desconto_cartao'])) { + $data['moip_desconto_cartao'] = $this->request->post['moip_desconto_cartao']; + } else { + $data['moip_desconto_cartao'] = $this->config->get('moip_desconto_cartao'); + } + + /* Autorizado */ + if (isset($this->request->post['moip_autorizado'])) { + $data['moip_autorizado'] = $this->request->post['moip_autorizado']; + } else { + $data['moip_autorizado'] = $this->config->get('moip_autorizado'); + } + + /* Status Iniciado */ + if (isset($this->request->post['moip_iniciado'])) { + $data['moip_iniciado'] = $this->request->post['moip_iniciado']; + } else { + $data['moip_iniciado'] = $this->config->get('moip_iniciado'); + } + + /* Status Boleto Impresso */ + if (isset($this->request->post['moip_boleto_impresso'])) { + $data['moip_boleto_impresso'] = $this->request->post['moip_boleto_impresso']; + } else { + $data['moip_boleto_impresso'] = $this->config->get('moip_boleto_impresso'); + } + + /* Status Completo */ + if (isset($this->request->post['moip_completo'])) { + $data['moip_completo'] = $this->request->post['moip_completo']; + } else { + $data['moip_completo'] = $this->config->get('moip_completo'); + } + + /* Status Cancelado */ + if (isset($this->request->post['moip_cancelado'])) { + $data['moip_cancelado'] = $this->request->post['moip_cancelado']; + } else { + $data['moip_cancelado'] = $this->config->get('moip_cancelado'); + } + + /* Em Análise */ + if (isset($this->request->post['moip_em_analise'])) { + $data['moip_em_analise'] = $this->request->post['moip_em_analise']; + } else { + $data['moip_em_analise'] = $this->config->get('moip_em_analise'); + } + + /* Revertido */ + if (isset($this->request->post['moip_revertido'])) { + $data['moip_revertido'] = $this->request->post['moip_revertido']; + } else { + $data['moip_revertido'] = $this->config->get('moip_revertido'); + } + + /* Em Revisão */ + if (isset($this->request->post['moip_em_revisao'])) { + $data['moip_em_revisao'] = $this->request->post['moip_em_revisao']; + } else { + $data['moip_em_revisao'] = $this->config->get('moip_em_revisao'); + } + + /* Reembolsado */ + if (isset($this->request->post['moip_reembolsado'])) { + $data['moip_reembolsado'] = $this->request->post['moip_reembolsado']; + } else { + $data['moip_reembolsado'] = $this->config->get('moip_reembolsado'); + } + + /* Geo Zone */ + if (isset($this->request->post['moip_geo_zone_id'])) { + $data['moip_geo_zone_id'] = $this->request->post['moip_geo_zone_id']; + } else { + $data['moip_geo_zone_id'] = $this->config->get('moip_geo_zone_id'); + } + + /* Sort Order / Ordem */ + if (isset($this->request->post['moip_sort_order'])) { + $data['moip_sort_order'] = $this->request->post['moip_sort_order']; + } else { + $data['moip_sort_order'] = $this->config->get('moip_sort_order'); + } + + /* Parcelas */ + if (isset($this->request->post['moip_parcela'])) { + $data['moip_parcela'] = $this->request->post['moip_parcela']; + } elseif ($this->config->get('moip_parcela')) { + $data['moip_parcela'] = $this->config->get('moip_parcela'); + } else { + $data['moip_parcela'] = array(); + } + + /* Boleto: Vencimento */ + if (isset($this->request->post['moip_boleto_vencimento'])) { + $data['moip_boleto_vencimento'] = $this->request->post['moip_boleto_vencimento']; + } else { + $data['moip_boleto_vencimento'] = $this->config->get('moip_boleto_vencimento'); + } + + /* Boleto: Instrução 1 */ + if (isset($this->request->post['moip_boleto_instrucao_1'])) { + $data['moip_boleto_instrucao_1'] = $this->request->post['moip_boleto_instrucao_1']; + } else { + $data['moip_boleto_instrucao_1'] = $this->config->get('moip_boleto_instrucao_1'); + } + + /* Boleto: Instrução 2 */ + if (isset($this->request->post['moip_boleto_instrucao_2'])) { + $data['moip_boleto_instrucao_2'] = $this->request->post['moip_boleto_instrucao_2']; + } else { + $data['moip_boleto_instrucao_2'] = $this->config->get('moip_boleto_instrucao_2'); + } + + /* Boleto: Instrução 3 */ + if (isset($this->request->post['moip_boleto_instrucao_3'])) { + $data['moip_boleto_instrucao_3'] = $this->request->post['moip_boleto_instrucao_3']; + } else { + $data['moip_boleto_instrucao_3'] = $this->config->get('moip_boleto_instrucao_3'); + } + + /* Boleto: Logo */ + if (isset($this->request->post['moip_boleto_logo'])) { + $data['moip_boleto_logo'] = $this->request->post['moip_boleto_logo']; + } else { + $data['moip_boleto_logo'] = $this->config->get('moip_boleto_logo'); + } + + /* Cartão de Crédito */ + if (isset($this->request->post['moip_cartao'])) { + $data['moip_cartao_credito'] = $this->request->post['moip_cartao']; + } else { + $data['moip_cartao_credito'] = $this->config->get('moip_cartao'); + } + + /* Cartão de Débito */ + if (isset($this->request->post['moip_debito'])) { + $data['moip_debito'] = $this->request->post['moip_debito']; + } else { + $data['moip_debito'] = $this->config->get('moip_debito'); + } + + /* Boleto */ + if (isset($this->request->post['moip_boleto'])) { + $data['moip_boleto'] = $this->request->post['moip_boleto']; + } else { + $data['moip_boleto'] = $this->config->get('moip_boleto'); + } + + /* Situações do Pedido */ + $data['statuses'] = $this->model_localisation_order_status->getOrderStatuses(); + + /* Zonas Geográficas */ + $data['zones'] = $this->model_localisation_geo_zone->getGeoZones(); + + /* Debug */ + if (file_exists(DIR_LOGS . 'moip.log')) { + if ((isset($this->request->post['moip_debug']) && $this->request->post['moip_debug'])) { + $data['debug'] = file(DIR_LOGS . 'moip.log'); + } elseif ($this->config->get('moip_debug')) { + $data['debug'] = file(DIR_LOGS . 'moip.log'); + } else { + $data['debug'] = array(); + } + } else { + $data['debug'] = array(); + } + + /* Links */ + $data['action'] = $this->url->link('payment/moip', 'token=' . $this->session->data['token'], true); + $data['cancel'] = $this->url->link('extension/payment', 'token=' . $this->session->data['token'], true); + + $data['header'] = $this->load->controller('common/header'); + $data['column_left'] = $this->load->controller('common/column_left'); + $data['footer'] = $this->load->controller('common/footer'); + + $this->response->setOutput($this->load->view('payment/moip.tpl', $data)); + } + + public function validate() { + if (!$this->user->hasPermission('modify', 'payment/moip')) { + $this->error['warning'] = $this->language->get('warning'); + } + + if (empty($this->request->post['moip_razao_pagamento'])) { + $this->error['razao_pagamento'] = $this->language->get('error_razao_pagamento'); + } + + if (empty($this->request->post['moip_token'])) { + $this->error['moip_token'] = $this->language->get('error_token'); + } + + if (empty($this->request->post['moip_key'])) { + $this->error['key'] = $this->language->get('error_key'); + } + + if ($this->request->post['moip_status']) { + + $this->request->post['moip_desconto_status'] = 1; + + if ($this->request->post['moip_cartao']) { + $this->request->post['moip_cartao_status'] = 1; + + if (!isset($this->request->post['moip_parcela']) || empty($this->request->post['moip_parcela'])) { + $this->error['parcelas'] = $this->language->get('error_parcelas'); + } + } else { + $this->request->post['moip_cartao_status'] = 0; + } + + if ($this->request->post['moip_debito']) { + $this->request->post['moip_debito_status'] = 1; + } else { + $this->request->post['moip_debito_status'] = 0; + } + + if ($this->request->post['moip_boleto']) { + $this->request->post['moip_boleto_status'] = 1; + } else { + $this->request->post['moip_boleto_status'] = 0; + } + + } else { + $this->request->post['moip_boleto_status'] = 0; + $this->request->post['moip_debito_status'] = 0; + $this->request->post['moip_debito_status'] = 0; + $this->request->post['moip_desconto_status'] = 0; + } + + return !$this->error; + } + + public function install(){ + $this->db->query("INSERT INTO `" . DB_PREFIX . "extension` (`type`, `code`) VALUES ('payment', 'moip_boleto') "); + $this->db->query("INSERT INTO `" . DB_PREFIX . "extension` (`type`, `code`) VALUES ('payment', 'moip_cartao') "); + $this->db->query("INSERT INTO `" . DB_PREFIX . "extension` (`type`, `code`) VALUES ('payment', 'moip_debito') "); + $this->db->query("INSERT INTO `" . DB_PREFIX . "extension` (`type`, `code`) VALUES ('total', 'moip_desconto') "); + } +} \ No newline at end of file diff --git a/upload/admin/controller/payment/moip_boleto.php b/upload/admin/controller/payment/moip_boleto.php new file mode 100644 index 0000000..f657939 --- /dev/null +++ b/upload/admin/controller/payment/moip_boleto.php @@ -0,0 +1,8 @@ +response->redirect($this->url->link('payment/moip', 'token=' . $this->session->data['token'], 'SSL')); + } + +} \ No newline at end of file diff --git a/upload/admin/controller/payment/moip_cartao.php b/upload/admin/controller/payment/moip_cartao.php new file mode 100644 index 0000000..7281c9d --- /dev/null +++ b/upload/admin/controller/payment/moip_cartao.php @@ -0,0 +1,8 @@ +response->redirect($this->url->link('payment/moip', 'token=' . $this->session->data['token'], 'SSL')); + } + +} \ No newline at end of file diff --git a/upload/admin/controller/payment/moip_debito.php b/upload/admin/controller/payment/moip_debito.php new file mode 100644 index 0000000..b666d3c --- /dev/null +++ b/upload/admin/controller/payment/moip_debito.php @@ -0,0 +1,8 @@ +response->redirect($this->url->link('payment/moip', 'token=' . $this->session->data['token'], 'SSL')); + } + +} \ No newline at end of file diff --git a/upload/admin/controller/total/moip_desconto.php b/upload/admin/controller/total/moip_desconto.php new file mode 100644 index 0000000..96d6806 --- /dev/null +++ b/upload/admin/controller/total/moip_desconto.php @@ -0,0 +1,8 @@ +response->redirect($this->url->link('payment/moip', 'token=' . $this->session->data['token'], 'SSL')); + } + +} \ No newline at end of file diff --git a/upload/admin/language/english/payment/moip.php b/upload/admin/language/english/payment/moip.php new file mode 100644 index 0000000..eacaa0c --- /dev/null +++ b/upload/admin/language/english/payment/moip.php @@ -0,0 +1,58 @@ +'; +$_['text_success'] = 'Módulo atualizado com sucesso'; + +//Entry +$_['entry_status'] = 'Situação:'; +$_['entry_razao_pagamento'] = 'Razão do Pagamento:'; +$_['entry_token'] = 'Token:'; +$_['entry_key'] = 'Key:'; +$_['entry_modo_teste'] = 'Modo de Teste?'; +$_['entry_debug'] = 'Debug'; +$_['entry_notificar_cliente'] = 'Notificar Cliente?'; +$_['entry_desconto_boleto'] = 'Desconto no Boleto:'; +$_['entry_desconto_debito'] = 'Desconto no Débito:'; +$_['entry_desconto_cartao'] = 'Desconto no Cartão:'; +$_['entry_autorizado'] = 'Autorizado:'; +$_['entry_iniciado'] = 'Iniciado:'; +$_['entry_boleto_impresso'] = 'Boleto Impresso:'; +$_['entry_completo'] = 'Completo:'; +$_['entry_cancelado'] = 'Cancelado:'; +$_['entry_em_analise'] = 'Em Análise:'; +$_['entry_revertido'] = 'Revertido:'; +$_['entry_em_revisao'] = 'Em Revisão:'; +$_['entry_reembolsado'] = 'Reembolsado:'; +$_['entry_geo_zone'] = 'Zona Geográfica:'; +$_['entry_sort_order'] = 'Ordem:'; +$_['entry_parcela_de'] = 'De'; +$_['entry_parcela_para'] = 'Para'; +$_['entry_parcela_juros'] = 'Juros'; +$_['entry_boleto_vencimento'] = 'Vencimento (Em Dias):'; +$_['entry_boleto_instrucao_1'] = 'Instrução 1'; +$_['entry_boleto_instrucao_2'] = 'Instrução 2'; +$_['entry_boleto_instrucao_3'] = 'Instrução 3'; +$_['entry_boleto_logo'] = 'Logo'; +$_['entry_cartao_credito'] = 'Cartão de Crédito'; +$_['entry_cartao_debito'] = 'Cartão de Débito'; +$_['entry_boleto'] = 'Boleto'; + +//Error +$_['warning'] = 'Você não tem permissão para modificar o módulo'; +$_['error_token'] = 'Campo Obrigatório'; +$_['moip_key'] = 'Campo Obrigatório'; +$_['error_parcelas'] = 'Campo Obrigatório'; \ No newline at end of file diff --git a/upload/admin/language/english/payment/moip_boleto.php b/upload/admin/language/english/payment/moip_boleto.php new file mode 100644 index 0000000..265b77e --- /dev/null +++ b/upload/admin/language/english/payment/moip_boleto.php @@ -0,0 +1,4 @@ +'; \ No newline at end of file diff --git a/upload/admin/language/english/payment/moip_cartao.php b/upload/admin/language/english/payment/moip_cartao.php new file mode 100644 index 0000000..d1368f8 --- /dev/null +++ b/upload/admin/language/english/payment/moip_cartao.php @@ -0,0 +1,4 @@ +'; \ No newline at end of file diff --git a/upload/admin/language/english/payment/moip_debito.php b/upload/admin/language/english/payment/moip_debito.php new file mode 100644 index 0000000..46dbd87 --- /dev/null +++ b/upload/admin/language/english/payment/moip_debito.php @@ -0,0 +1,4 @@ +'; \ No newline at end of file diff --git a/upload/admin/language/english/total/moip_desconto.php b/upload/admin/language/english/total/moip_desconto.php new file mode 100644 index 0000000..e45ed8f --- /dev/null +++ b/upload/admin/language/english/total/moip_desconto.php @@ -0,0 +1,3 @@ + +
+ + + + + +
+ + + +
+ + +
+ + + +
+ + +
+

+
+ + +
+ + + + + +
+
+ + +
+ + +
+ +
+ +
+
+ + +
+ +
+ + +
+ +
+
+ + +
+ +
+ + +
+ +
+
+ + +
+ +
+ + +
+ +
+
+ + +
+ +
+ + + + + + + + + + + +
+
+ + +
+ +
+ + + + + + + + + + + +
+
+ + +
+ +
+ + + + + + + + + + + +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + +
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + +
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+ + +
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + +
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + +
+
+ https://labs.moip.com.br/playground/ + +
+
+ '; + } + ?> +
+
+ + + +
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/upload/catalog/controller/payment/moip.php b/upload/catalog/controller/payment/moip.php new file mode 100644 index 0000000..290fe2e --- /dev/null +++ b/upload/catalog/controller/payment/moip.php @@ -0,0 +1,61 @@ +load->model('payment/moip'); + + //Captura o ID do Pedido + $order_id = $this->request->post['id_transacao']; + + //Captura o Status de Pagamento + switch ($this->request->post['status_pagamento']) { + case 1: + $status_pagamento = $this->config->get('moip_autorizado'); + break; + case 2: + $status_pagamento = $this->config->get('moip_iniciado'); + break; + case 3: + $status_pagamento = $this->config->get('moip_boleto_impresso'); + break; + case 4: + $status_pagamento = $this->config->get('moip_completo'); + break; + case 5: + $status_pagamento = $this->config->get('moip_cancelado'); + break; + case 6: + $status_pagamento = $this->config->get('moip_em_analise'); + break; + case 7: + $status_pagamento = $this->config->get('moip_revertido'); + break; + case 8: + $status_pagamento = $this->config->get('moip_em_revisao'); + break; + case 9: + $status_pagamento = $this->config->get('moip_reembolsado'); + break; + default: + $status_pagamento = $this->config->get('moip_iniciado'); + break; + } + + //Captura a informação caso o pedido seja cancelado + if (isset($this->request->post['classificacao'])) { + $classificacao = $this->request->post['classificacao']; + } else { + $classificacao = ''; + } + + //Verifica se notifica ao cliente + if ($this->config->get('moip_notificar_cliente')) { + $notificacao = true; + } else { + $notificacao = false; + } + + //Atualiza pedido + $this->model_payment_moip->nasp($order_id, $status_pagamento, $classificacao, $notificacao); + } +} \ No newline at end of file diff --git a/upload/catalog/controller/payment/moip_boleto.php b/upload/catalog/controller/payment/moip_boleto.php new file mode 100644 index 0000000..000abe6 --- /dev/null +++ b/upload/catalog/controller/payment/moip_boleto.php @@ -0,0 +1 @@ +session->data['order_id']; $data = array(); //Carrega models $this->load->model('checkout/order'); $this->load->model('payment/moip'); //Adiciona os dados da compra no array order_info $order_info = $this->model_checkout_order->getOrder($order_id); //Captura a 'razão' cadastrato no módulo de pagamento MoiP no painel administrativo $data['nometranzacao'] = $this->config->get('moip_razao_pagamento'); //Captura o 'Token' cadastrato no módulo de pagamento MoiP no painel administrativo $data['apitoken'] = $this->config->get('moip_token'); //Captura a 'Key' cadastrato no módulo de pagamento MoiP no painel administrativo $data['apikey'] = $this->config->get('moip_key'); //Captura o ID do Cliente $data['customer_id'] = $order_info['customer_id']; //Captura o telefone do Cliente $data['telephone'] = $order_info['telephone']; //Captura o tipo da moeda utilizada na compra $data['currency_code'] = $order_info['currency_code']; //Captura o valor total $data['amount'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false); //Captura o primeiro nome do Cliente e remove os caracteres especiais $data['firstname'] = $this->removeAcentos($order_info['payment_firstname']); //Captura o sobrenome do cliente e remove os caracteres especiais $data['lastname'] = $this->removeAcentos($order_info['payment_lastname']); //Captura o email do Cliente $data['email'] = $order_info['email']; //Captura o logadouro do cliente e remove os caracteres especiais $data['address_1'] = $this->removeAcentos($order_info['payment_address_1']); //Captura o bairro do cliente e remove os caracteres especiais $data['address_2'] = $this->removeAcentos($order_info['payment_address_2']); //Captura a cidade do Cliente e remove os caracteres especiais $data['city'] = $this->removeAcentos($order_info['payment_city']); //Captura o CEP do Cliente $data['postcode'] = preg_replace('/[^0-9]/', '', $order_info['payment_postcode']); //Captura o estado do Cliente $data['zone'] = $order_info['payment_zone_code']; //Captura o País do Cliente $data['country'] = $order_info['payment_country']; //Captura o id da compra $data['order_id'] = $order_id; //Captura o comentário do pedido $data['comment'] = $order_info['comment']; //Captura o código do MoIP $data['code'] = $this->model_payment_moip->captureToken($data); //Links $data['continue'] = $this->url->link('checkout/success', '', 'SSL'); return $this->load->view('payment/moip_boleto.tpl', $data); } private function removeAcentos($text) { $acentos = array('Á','À','Â','Ã','É','Ê','Í','Ó','Ô','Õ','Ú','Ç','á','à','â','ã','é','ê','í','ó','ô','õ','ú','ç','æ'); $sAcentos = array('A','A','A','A','E','E','I','O','O','O','U','C','a','a','a','a','e','e','i','o','o','o','u','c','AE'); return str_replace($acentos, $sAcentos, $text); } public function confirm() { $this->load->model('checkout/order'); $this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('config_order_status_id')); if (isset($this->session->data['order_id'])) { $this->cart->clear(); unset($this->session->data['shipping_method']); unset($this->session->data['shipping_methods']); unset($this->session->data['payment_method']); unset($this->session->data['payment_methods']); unset($this->session->data['comment']); unset($this->session->data['coupon']); } } } \ No newline at end of file diff --git a/upload/catalog/controller/payment/moip_cartao.php b/upload/catalog/controller/payment/moip_cartao.php new file mode 100644 index 0000000..15bf8f7 --- /dev/null +++ b/upload/catalog/controller/payment/moip_cartao.php @@ -0,0 +1,103 @@ +session->data['order_id']; + + $data = array(); + + //Carrega models + $this->load->model('checkout/order'); + $this->load->model('payment/moip'); + + //Adiciona os dados da compra no array order_info + $order_info = $this->model_checkout_order->getOrder($order_id); + + //Captura a 'razão' cadastrato no módulo de pagamento MoiP no painel administrativo + $data['nometranzacao'] = $this->config->get('moip_razao_pagamento'); + + //Captura o 'Token' cadastrato no módulo de pagamento MoiP no painel administrativo + $data['apitoken'] = $this->config->get('moip_token'); + + //Captura a 'Key' cadastrato no módulo de pagamento MoiP no painel administrativo + $data['apikey'] = $this->config->get('moip_key'); + + //Captura o ID do Cliente + $data['customer_id'] = $order_info['customer_id']; + + //Captura o telefone do Cliente + $data['telephone'] = $order_info['telephone']; + + //Captura o tipo da moeda utilizada na compra + $data['currency_code'] = $order_info['currency_code']; + + //Captura o valor total + $data['amount'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false); + + //Captura o primeiro nome do Cliente e remove os caracteres especiais + $data['firstname'] = $this->removeAcentos($order_info['payment_firstname']); + + //Captura o sobrenome do cliente e remove os caracteres especiais + $data['lastname'] = $this->removeAcentos($order_info['payment_lastname']); + + //Captura o email do Cliente + $data['email'] = $order_info['email']; + + //Captura o logadouro do cliente e remove os caracteres especiais + $data['address_1'] = $this->removeAcentos($order_info['payment_address_1']); + + //Captura o bairro do cliente e remove os caracteres especiais + $data['address_2'] = $this->removeAcentos($order_info['payment_address_2']); + + //Captura a cidade do Cliente e remove os caracteres especiais + $data['city'] = $this->removeAcentos($order_info['payment_city']); + + //Captura o CEP do Cliente + $data['postcode'] = preg_replace('/[^0-9]/', '', $order_info['payment_postcode']); + + //Captura o estado do Cliente + $data['zone'] = $order_info['payment_zone_code']; + + //Captura o País do Cliente + $data['country'] = $order_info['payment_country']; + + //Captura o id da compra + $data['order_id'] = $order_id; + + //Captura o comentário do pedido + $data['comment'] = $order_info['comment']; + + //Captura o código do MoIP + $data['code'] = $this->model_payment_moip->captureToken($data); + + //Links + $data['continue'] = $this->url->link('checkout/success', '', 'SSL'); + + return $this->load->view('payment/moip_cartao.tpl', $data); + } + + private function removeAcentos($text) { + $acentos = array('Á','À','Â','Ã','É','Ê','Í','Ó','Ô','Õ','Ú','Ç','á','à','â','ã','é','ê','í','ó','ô','õ','ú','ç','æ'); + $sAcentos = array('A','A','A','A','E','E','I','O','O','O','U','C','a','a','a','a','e','e','i','o','o','o','u','c','AE'); + + return str_replace($acentos, $sAcentos, $text); + } + + public function confirm() { + $this->load->model('checkout/order'); + + $this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('config_order_status_id')); + + if (isset($this->session->data['order_id'])) { + $this->cart->clear(); + unset($this->session->data['shipping_method']); + unset($this->session->data['shipping_methods']); + unset($this->session->data['payment_method']); + unset($this->session->data['payment_methods']); + unset($this->session->data['comment']); + unset($this->session->data['coupon']); + } + } +} \ No newline at end of file diff --git a/upload/catalog/controller/payment/moip_debito.php b/upload/catalog/controller/payment/moip_debito.php new file mode 100644 index 0000000..f93f46d --- /dev/null +++ b/upload/catalog/controller/payment/moip_debito.php @@ -0,0 +1,104 @@ +session->data['order_id']; + + $data = array(); + + //Carrega models + $this->load->model('checkout/order'); + $this->load->model('payment/moip'); + + //Adiciona os dados da compra no array order_info + $order_info = $this->model_checkout_order->getOrder($order_id); + + //Captura a 'razão' cadastrato no módulo de pagamento MoiP no painel administrativo + $data['nometranzacao'] = $this->config->get('moip_razao_pagamento'); + + //Captura o 'Token' cadastrato no módulo de pagamento MoiP no painel administrativo + $data['apitoken'] = $this->config->get('moip_token'); + + //Captura a 'Key' cadastrato no módulo de pagamento MoiP no painel administrativo + $data['apikey'] = $this->config->get('moip_key'); + + //Captura o ID do Cliente + $data['customer_id'] = $order_info['customer_id']; + + //Captura o telefone do Cliente + $data['telephone'] = $order_info['telephone']; + + //Captura o tipo da moeda utilizada na compra + $data['currency_code'] = $order_info['currency_code']; + + //Captura o valor total + $data['amount'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false); + + //Captura o primeiro nome do Cliente e remove os caracteres especiais + $data['firstname'] = $this->removeAcentos($order_info['payment_firstname']); + + //Captura o sobrenome do cliente e remove os caracteres especiais + $data['lastname'] = $this->removeAcentos($order_info['payment_lastname']); + + //Captura o email do Cliente + $data['email'] = $order_info['email']; + + //Captura o logadouro do cliente e remove os caracteres especiais + $data['address_1'] = $this->removeAcentos($order_info['payment_address_1']); + + //Captura o bairro do cliente e remove os caracteres especiais + $data['address_2'] = $this->removeAcentos($order_info['payment_address_2']); + + //Captura a cidade do Cliente e remove os caracteres especiais + $data['city'] = $this->removeAcentos($order_info['payment_city']); + + //Captura o CEP do Cliente + $data['postcode'] = preg_replace('/[^0-9]/', '', $order_info['payment_postcode']); + + //Captura o estado do Cliente + $data['zone'] = $order_info['payment_zone_code']; + + //Captura o País do Cliente + $data['country'] = $order_info['payment_country']; + + //Captura o id da compra + $data['order_id'] = $order_id; + + //Captura o comentário do pedido + $data['comment'] = $order_info['comment']; + + //Captura o código do MoIP + $data['code'] = $this->model_payment_moip->captureToken($data); + + //Links + $data['continue'] = $this->url->link('checkout/success', '', 'SSL'); + + return $this->load->view('payment/moip_debito.tpl', $data); + } + + private function removeAcentos($text) { + $acentos = array('Á','À','Â','Ã','É','Ê','Í','Ó','Ô','Õ','Ú','Ç','á','à','â','ã','é','ê','í','ó','ô','õ','ú','ç','æ'); + $sAcentos = array('A','A','A','A','E','E','I','O','O','O','U','C','a','a','a','a','e','e','i','o','o','o','u','c','AE'); + + return str_replace($acentos, $sAcentos, $text); + } + + public function confirm() { + $this->load->model('checkout/order'); + + $this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('config_order_status_id')); + + if (isset($this->session->data['order_id'])) { + $this->cart->clear(); + unset($this->session->data['shipping_method']); + unset($this->session->data['shipping_methods']); + unset($this->session->data['payment_method']); + unset($this->session->data['payment_methods']); + unset($this->session->data['comment']); + unset($this->session->data['coupon']); + } + + } +} \ No newline at end of file diff --git a/upload/catalog/language/english/payment/moip.php b/upload/catalog/language/english/payment/moip.php new file mode 100644 index 0000000..5cd17cb --- /dev/null +++ b/upload/catalog/language/english/payment/moip.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/upload/catalog/model/payment/moip.php b/upload/catalog/model/payment/moip.php new file mode 100644 index 0000000..f695c6e --- /dev/null +++ b/upload/catalog/model/payment/moip.php @@ -0,0 +1,133 @@ +config->get('moip_modo_teste')) { + $action = 'https://www.moip.com.br/ws/alpha/EnviarInstrucao/Unica'; + } else { + $action = 'https://desenvolvedor.moip.com.br/sandbox/ws/alpha/EnviarInstrucao/Unica'; + } + + // Inicia cURL + $ch = curl_init(); + + $header[] = "Authorization: Basic " . base64_encode($this->config->get('moip_token').':'.$this->config->get('moip_key')); + + $postfields = utf8_encode(' + + + ' . $this->config->get('moip_razao_pagamento') . ' + + ' . $data['amount'] . ' + + ' . $data['order_id'] . ' + + ' . $data['firstname'] . ' ' . $data['lastname'] . ' + ' . $data['email'] . ' + ' . $data['customer_id'] . ' + + ' . $data['address_1'] . ' + 00 + Desconhecido + ' . $data['address_2'] . ' + ' . $data['city'] . ' + ' . $data['zone'] . ' + BRA + ' . $data['postcode'] . ' + ' . $data['telephone'] . ' + + + + ' . $this->config->get('moip_boleto_vencimento') . ' + ' . $this->config->get('moip_boleto_instrucao_1') . ' + ' . $this->config->get('moip_boleto_instrucao_2') . ' + ' . $this->config->get('moip_boleto_instrucao_3') . ' + ' . $this->config->get('moip_boleto_logo') . ' + + + ' . $data['comment'] . ' + + ' . $this->parcelas() . ' + + + '); + + // Seta opçoes e parâmetro + $options = array(CURLOPT_URL => $action, + CURLOPT_HTTPHEADER => $header, + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $postfields, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_SSLVERSION => 1 + ); + curl_setopt_array($ch, $options); + + // Executa cURL + $response = curl_exec($ch); + $curl_info = curl_getinfo($ch); + $curl_error = curl_error($ch); + + // Fecha coneçao cURL + curl_close($ch); + + // Transforma string em elemento XML + $xml = simplexml_load_string($response); + + if ($this->config->get('moip_debug')) { + + if (file_exists(DIR_LOGS . 'moip.log')) { + unlink(DIR_LOGS . 'moip.log'); + } + + $logs = new Log('moip.log'); + $logs->write(html_entity_decode($postfields)); + $logs->write(html_entity_decode($response)); + + if (is_array($curl_info)) + $logs->write(html_entity_decode(json_encode($curl_info))); + else + $logs->write(html_entity_decode($curl_info)); + + $logs->write(html_entity_decode($curl_error)); + } + + // Acessa XML e pega "Token de Pagamento" + if (isset($xml->Resposta->Erro)) + return $xml->Resposta->Erro; + else + return $xml->Resposta->Token; + } + + public function parcelas() { + $parcelas = $this->config->get('moip_parcela'); + + $parcelamento = ''; + + if (!empty($parcelas)) { + $parcelamento .= ''; + + foreach($parcelas as $parcela) { + $parcelamento .= ' '; + $parcelamento .= ' ' . $parcela['de'] . ''; + $parcelamento .= ' ' . $parcela['para'] . ''; + $parcelamento .= ' ' . $parcela['juros'] . ''; + $parcelamento .= ' '; + } + $parcelamento .= ''; + } + + return $parcelamento; + } + + public function nasp($order_id, $order_status_id, $comment = '', $notify = false) { + $this->load->model('checkout/order'); + + $this->model_checkout_order->addOrderHistory($order_id, $order_status_id, $comment, $notify); + } + +} \ No newline at end of file diff --git a/upload/catalog/model/payment/moip_boleto.php b/upload/catalog/model/payment/moip_boleto.php new file mode 100644 index 0000000..f829867 --- /dev/null +++ b/upload/catalog/model/payment/moip_boleto.php @@ -0,0 +1,29 @@ +load->language('payment/moip'); + + $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('cod_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')"); + + if (!$this->config->get('moip_geo_zone_id')) { + $status = true; + } elseif ($query->num_rows) { + $status = true; + } else { + $status = false; + } + + $method_data = array(); + + if ($status) { + $method_data = array( + 'code' => 'moip_boleto', + 'title' => $this->language->get('text_boleto'), + 'terms' => '', + 'sort_order' => $this->config->get('moip_sort_order') + ); + } + + return $method_data; + } +} \ No newline at end of file diff --git a/upload/catalog/model/payment/moip_cartao.php b/upload/catalog/model/payment/moip_cartao.php new file mode 100644 index 0000000..013fc57 --- /dev/null +++ b/upload/catalog/model/payment/moip_cartao.php @@ -0,0 +1,29 @@ +load->language('payment/moip'); + + $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('cod_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')"); + + if (!$this->config->get('moip_geo_zone_id')) { + $status = true; + } elseif ($query->num_rows) { + $status = true; + } else { + $status = false; + } + + $method_data = array(); + + if ($status) { + $method_data = array( + 'code' => 'moip_cartao', + 'title' => $this->language->get('text_cartao'), + 'terms' => '', + 'sort_order' => $this->config->get('moip_sort_order') + ); + } + + return $method_data; + } +} \ No newline at end of file diff --git a/upload/catalog/model/payment/moip_debito.php b/upload/catalog/model/payment/moip_debito.php new file mode 100644 index 0000000..70e47f2 --- /dev/null +++ b/upload/catalog/model/payment/moip_debito.php @@ -0,0 +1,29 @@ +load->language('payment/moip'); + + $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('cod_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')"); + + if (!$this->config->get('moip_geo_zone_id')) { + $status = true; + } elseif ($query->num_rows) { + $status = true; + } else { + $status = false; + } + + $method_data = array(); + + if ($status) { + $method_data = array( + 'code' => 'moip_debito', + 'title' => $this->language->get('text_debito'), + 'terms' => '', + 'sort_order' => $this->config->get('moip_sort_order') + ); + } + + return $method_data; + } +} \ No newline at end of file diff --git a/upload/catalog/model/total/moip_desconto.php b/upload/catalog/model/total/moip_desconto.php new file mode 100644 index 0000000..364b97d --- /dev/null +++ b/upload/catalog/model/total/moip_desconto.php @@ -0,0 +1,54 @@ +session->data['payment_method']['code'])) { + + $valor_desconto = 0; + + if ($this->session->data['payment_method']['code'] == 'moip_boleto') { + + $this->load->language('payment/moip'); + + if (preg_match('/[%]/', $this->config->get('moip_desconto_boleto'))) { + $percentual = preg_replace('/[^0-9.]/', '', $this->config->get('moip_desconto_boleto')) / 100; + $valor_desconto = ($percentual * $this->cart->getSubTotal()); + } else { + $valor_desconto = preg_replace('/[^0-9.]/', '', $this->config->get('moip_desconto_boleto')); + } + + } elseif ($this->session->data['payment_method']['code'] == 'moip_cartao') { + + $this->load->language('payment/moip'); + + if (preg_match('/[%]/', $this->config->get('moip_desconto_cartao'))) { + $percentual = preg_replace('/[^0-9.]/', '', $this->config->get('moip_desconto_cartao')) / 100; + $valor_desconto = ($percentual * $this->cart->getSubTotal()); + } else { + $valor_desconto = preg_replace('/[^0-9.]/', '', $this->config->get('moip_desconto_cartao')); + } + + } elseif ($this->session->data['payment_method']['code'] == 'moip_debito') { + + $this->load->language('payment/moip'); + + if (preg_match('/[%]/', $this->config->get('moip_desconto_debito'))) { + $percentual = preg_replace('/[^0-9.]/', '', $this->config->get('moip_desconto_debito')) / 100; + $valor_desconto = ($percentual * $this->cart->getSubTotal()); + } else { + $valor_desconto = preg_replace('/[^0-9.]/', '', $this->config->get('moip_desconto_debito')); + } + } + + if ($valor_desconto > 0) { + $total['total'] -= $valor_desconto; + + $total['totals'][] = array( + 'code' => 'moip_desconto', + 'title' => $this->language->get('text_desconto'), + 'value' => -$valor_desconto, + 'sort_order' => ($this->config->get('sub_total_sort_order') + 1) + ); + } + } + } +} \ No newline at end of file diff --git a/upload/catalog/view/javascript/moip/colorbox/colorbox.css b/upload/catalog/view/javascript/moip/colorbox/colorbox.css new file mode 100644 index 0000000..8a4ff99 --- /dev/null +++ b/upload/catalog/view/javascript/moip/colorbox/colorbox.css @@ -0,0 +1,70 @@ +/* + Colorbox Core Style: + The following CSS is consistent between example themes and should not be altered. +*/ +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxWrapper {max-width:none;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} +#cboxTitle{margin:0;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} +#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} +#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} + +/* + User Style: + Change the following styles to modify the appearance of Colorbox. They are + ordered & tabbed in a way that represents the nesting of the generated HTML. +*/ +#cboxOverlay{background:url(images/overlay.png) repeat 0 0; opacity: 0.9; filter: alpha(opacity = 90);} +#colorbox{outline:0;} + #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;} + #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;} + #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;} + #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;} + #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;} + #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;} + #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;} + #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;} + #cboxContent{background:#fff; overflow:hidden;} + .cboxIframe{background:#fff;} + #cboxError{padding:50px; border:1px solid #ccc;} + #cboxLoadedContent{margin-bottom:28px;} + #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;} + #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;} + #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;} + #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + + #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;} + #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxPrevious:hover{background-position:-75px -25px;} + #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxNext:hover{background-position:-50px -25px;} + #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxClose:hover{background-position:-25px -25px;} + +/* + The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill + when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9. + See: http://jacklmoore.com/notes/ie-transparency-problems/ +*/ +.cboxIE #cboxTopLeft, +.cboxIE #cboxTopCenter, +.cboxIE #cboxTopRight, +.cboxIE #cboxBottomLeft, +.cboxIE #cboxBottomCenter, +.cboxIE #cboxBottomRight, +.cboxIE #cboxMiddleLeft, +.cboxIE #cboxMiddleRight { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); +} \ No newline at end of file diff --git a/upload/catalog/view/javascript/moip/colorbox/images/border.png b/upload/catalog/view/javascript/moip/colorbox/images/border.png new file mode 100644 index 0000000..9386f35 Binary files /dev/null and b/upload/catalog/view/javascript/moip/colorbox/images/border.png differ diff --git a/upload/catalog/view/javascript/moip/colorbox/images/controls.png b/upload/catalog/view/javascript/moip/colorbox/images/controls.png new file mode 100644 index 0000000..1ec3cb1 Binary files /dev/null and b/upload/catalog/view/javascript/moip/colorbox/images/controls.png differ diff --git a/upload/catalog/view/javascript/moip/colorbox/images/loading.gif b/upload/catalog/view/javascript/moip/colorbox/images/loading.gif new file mode 100644 index 0000000..0325c8d Binary files /dev/null and b/upload/catalog/view/javascript/moip/colorbox/images/loading.gif differ diff --git a/upload/catalog/view/javascript/moip/colorbox/images/loading_background.png b/upload/catalog/view/javascript/moip/colorbox/images/loading_background.png new file mode 100644 index 0000000..23a336b Binary files /dev/null and b/upload/catalog/view/javascript/moip/colorbox/images/loading_background.png differ diff --git a/upload/catalog/view/javascript/moip/colorbox/images/overlay.png b/upload/catalog/view/javascript/moip/colorbox/images/overlay.png new file mode 100644 index 0000000..10362a4 Binary files /dev/null and b/upload/catalog/view/javascript/moip/colorbox/images/overlay.png differ diff --git a/upload/catalog/view/javascript/moip/colorbox/jquery.colorbox-min.js b/upload/catalog/view/javascript/moip/colorbox/jquery.colorbox-min.js new file mode 100644 index 0000000..c0cbe5c --- /dev/null +++ b/upload/catalog/view/javascript/moip/colorbox/jquery.colorbox-min.js @@ -0,0 +1,6 @@ +/*! + Colorbox 1.5.14 + license: MIT + http://www.jacklmoore.com/colorbox +*/ +(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(z+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in y[0]&&!y[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),y.focus())}function c(t){c.str!==t&&(y.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){z=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),z=W.index(_.el),-1===z&&(W=W.add(_.el),z=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!$){$=q=!0,c(_.get("className")),y.css({visibility:"hidden",display:"block",opacity:""}),L=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(L),D=T.height()+k.height()+b.outerHeight(!0)-b.height(),j=C.width()+H.width()+b.outerWidth(!0)-b.width(),A=L.outerHeight(!0),N=L.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=(l!==!1?Math.min(h,a(l,"x")):h)-N-j,_.h=(f!==!1?Math.min(s,a(f,"y")):s)-A-D,L.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),y.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("
"),w()}}function p(){y||(V=!1,E=t(i),y=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),S=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),x=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),I=n(se,"Current"),P=t(' -

- - -
- - - - Autor do Formulário: Codrops - - - \ No newline at end of file diff --git a/vqmod/xml/moip.xml b/vqmod/xml/moip.xml deleted file mode 100644 index dfa6f8e..0000000 --- a/vqmod/xml/moip.xml +++ /dev/null @@ -1 +0,0 @@ - ]]> data['text_zone'] = $this->language->get('text_zone');]]> session->data['token'])): $token = $this->session->data['token']; else: $token = ''; endif; $this->load->language('moip/header'); $this->data['text_moip'] = $this->language->get('header_text_moip'); $this->data['text_pedidos'] = $this->language->get('header_text_pedidos'); $this->data['text_documentacao'] = $this->language->get('header_text_documentacao'); $this->data['text_faq'] = $this->language->get('header_text_faq'); $this->data['text_desinstalar'] = $this->language->get('header_text_desinstalar'); $this->data['link_pedidos'] = $this->url->link('moip/moip', 'token=' . $token); $this->data['link_faq'] = HTTPS_CATALOG.'valdeir/moip/documentacao/'; $this->data['link_desinstalar'] = HTTPS_CATALOG.'valdeir/moip/desinstalar/'; ]]> ]]>
]]>
]]> ]]> data['title'] = $this->document->getTitle();]]> config->get('moip_test')) { $this->data['MoiPJS'] = 'https://www.moip.com.br/transparente/MoipWidget-v2.js'; } else { $this->data['MoiPJS'] = 'https://desenvolvedor.moip.com.br/sandbox/transparente/MoipWidget-v2.js'; }]]>
\ No newline at end of file