Skip to content

Commit

Permalink
Merge pull request #81 from bitpopulous/mak_dev
Browse files Browse the repository at this point in the history
- Populous  User API Ammended
  • Loading branch information
nico1579 committed Oct 18, 2021
2 parents e4e82b1 + 5712663 commit 54b48a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
18 changes: 5 additions & 13 deletions src/Api/Populous.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ private function _call(string $url, array $params = [])
$ch = curl_init();

$_d = $params;
// $_d['_data'] = $params;

$postFields = http_build_query($_d);
// $postFields = $_d;

// $this->log->debug('Postfields : ' . $postFields);
// log_message('debug', 'Streamer => Postfields : ' . $postFields);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
Expand All @@ -48,13 +41,12 @@ private function _call(string $url, array $params = [])

$headers = array();
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
$headers[] = 'api_key: ' . $this->apiKey;
$headers[] = 'secret_key: ' . $this->secretKey;
$headers[] = 'internal_call: populous';
$headers[] = HEADER_KEY_API_KEY . ': ' . $this->apiKey;
$headers[] = HEADER_KEY_SECRET_KEY . ': ' . $this->secretKey;
$headers[] = HEADER_KEY_INTERNAL_CALL . ': ' . HEADER_VAL_INTERNAL_CALL;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
log_message('debug', $result);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
Expand Down Expand Up @@ -96,12 +88,12 @@ public function getStatus()
public function order(array $formData = [])
{

return $this->_call($this->endpoint . '/userapi/order', $formData);
return $this->_call($this->endpoint . '/UserApi/order', $formData);
}

public function cancel(array $formData = [])
{
return $this->_call($this->endpoint . '/userapi/cancel', $formData);
return $this->_call($this->endpoint . '/UserApi/cancel', $formData);
}


Expand Down
4 changes: 2 additions & 2 deletions src/Trade/Buy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Buy extends Trade

private $executedSellerOrders = [];

public function __construct($isInternal = false)
public function __construct($isBroadcasterRequired = false)
{
parent::__construct(!$isInternal);
parent::__construct($isBroadcasterRequired);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Trade/Sell.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Sell extends Trade
private $executedBuyerOrders = [];


public function __construct($isInternal = false)
public function __construct($isBroadcasterRequired = false)
{
parent::__construct(!$isInternal);
parent::__construct($isBroadcasterRequired);
}

private function _do_sell_trade($selltrade, $buytrade)
Expand Down
2 changes: 0 additions & 2 deletions src/Trade/Trade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public function __construct($isBroadcasterRequired = true)

$this->broadcasterRequired = $isBroadcasterRequired;

// $this->wss_server = new ServerHandler();

$this->CI->load->model([
'WsServer_model',
]);
Expand Down

0 comments on commit 54b48a3

Please sign in to comment.