Skip to content

Commit

Permalink
feat: adiciona metodo para cadastro de atualizaçoes
Browse files Browse the repository at this point in the history
  • Loading branch information
valdeir2000 committed Sep 12, 2020
1 parent 704c987 commit 5eed398
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions upload/admin/controller/extension/payment/pagseguro.php
Expand Up @@ -54,6 +54,7 @@ public function index()
$this->session->data['success'] = $this->language->get('text_success');

$this->telemetry();
$this->newsletter();

$this->response->redirect($this->buildUrl('marketplace/extension', [
'type' => 'payment'
Expand Down Expand Up @@ -303,6 +304,29 @@ private function telemetry()
}
}

/**
* Cadastra e-mail para receber alertas
*/
private function newsletter()
{
$method = !empty($this->request->post['newsletter'])
? 'POST'
: 'DELETE';

$fields = [
'email' => $this->request->post['newsletter']
];

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://opencart.valdeirsantana.com.br/newsletter');
curl_setopt($curl, CURLOPT_USERAGENT, 'PagSeguro Checkout Transparente for OpenCart');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($fields));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
curl_exec($curl);
curl_close($curl);
}

/**
* Instala e adiciona permissão para editar os módulos de pagamento:
* - PagSeguro Boleto
Expand Down

0 comments on commit 5eed398

Please sign in to comment.