Completed
Push — master ( 2990ff...464782 )
by Ricardo
02:32
created

ExactSales   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 54
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConnection() 0 5 1
1
<?php
2
3
namespace Integrations\Connectors\ExactSales;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Log;
7
use App\Models\User;
8
use Integrations\Connectors\Connector;
9
10
class ExactSales extends Connector
11
{
12
    public static $ID = 33;
13
    protected function getConnection($token = false)
14
    {
15
        $token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx';
16
        return new Pipedrive($token);
17
    }
18
19
    // private $config;
20
	// private $curl;
21
	// private $token;
22
	// private $apiUrl = "api.spotter.exactsales.com.br/api/v2";
23
	// private $apiProcotol = "https://";
24
25
	// public function __construct($token)
26
	// {
27
	// 	$this->curl = new Curl();
28
	// 	$this->token = $token;
29
	// }
30
31
	// public function inserirLead($parameters, $validar_duplicidade = 1, $addcampospersonalizados = 0)
32
	// {
33
	// 	$this->curl->setOpt(CURLOPT_RETURNTRANSFER, TRUE);
34
	// 	$this->curl->setOpt(CURLOPT_HEADER, FALSE);
35
	// 	$this->curl->setOpt(CURLOPT_HTTPHEADER, array(
36
	// 			"Content-Type: application/json",
37
  	// 			"token_exact: ".$this->token
38
	// 		)
39
	// 	);
40
	// 	$url = $this->apiProcotol.$this->apiUrl."/leads?validar_duplicidade=".$validar_duplicidade."&addcampospersonalizados=".$addcampospersonalizados;
41
	// 	$this->curl->post($url, json_encode($parameters));
42
	// 	if ($this->curl->error)
43
    //         return $this->treatError();
44
    //     else
45
    //         return $this->treatSuccess($this->curl->response);
46
        
47
	// }
48
49
	// private function treatSuccess($response)
50
	// {
51
	// 	$response = json_decode($response, true);
52
	// 	return $response;
53
	// }
54
55
	// private function treatError()
56
    // {
57
    //     $message = array();
58
    //     $message['error'] = true;
59
    //     $message['error_code'] = $this->curl->error_code;
60
    //     $message['error_message'] = $this->curl->error_message;
61
    //     return json_encode($message);
62
    // }
63
}
64