Skip to content

Commit

Permalink
New DMarket Api fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Allyans3 committed Dec 14, 2020
1 parent ed03f8f commit 77cec89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $options = [
'priceTo' => 0, // 0 if from -Inf to +Inf
'treeFilters' => '',
'types' => 'dmarket', // ['dmarket', 'p2p']
'offset' => 0,
'cursor' => '',
'limit' => 100,
'currency' => 'USD',
'platform' => 'browser',
Expand Down
14 changes: 7 additions & 7 deletions src/Requests/MarketItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@

class MarketItems extends Request implements RequestInterface
{
const URL = 'https://trading.dmarket.com/exchange/v1/market/items?gameId=%s&title=%s&currency=%s&orderBy=%s&orderDir=%s&priceFrom=%s&priceTo=%s&treeFilters=%s&types=%s&offset=%s&limit=%s&platform=%s&isLoggedIn=%s';
const URL = 'https://trading.dmarket.com/exchange/v1/market/items?gameId=%s&title=%s&currency=%s&orderBy=%s&orderDir=%s&priceFrom=%s&priceTo=%s&treeFilters=%s&types=%s&cursor=%s&limit=%s&platform=%s&isLoggedIn=%s';

private string $gameId;
private string $title = '';
private string $currency = 'USD';
private string $orderBy = 'best_deals';
private string $orderDir = 'desc';
private string $title = '';
private int $priceFrom = 0;
private int $priceTo = 0;
private string $treeFilters = '';
private string $types = 'dmarket';
private int $offset = 0;
private string $cursor = '';
private int $limit = 100;
private string $currency = 'USD';
private string $platform = 'browser';
private bool $isLoggedIn = true;

Expand All @@ -34,8 +34,8 @@ public function __construct($gameId, $options = [])
public function getUrl()
{
return sprintf(self::URL, $this->gameId, $this->title, $this->currency, $this->orderBy, $this->orderDir,
$this->priceFrom, $this->priceTo, $this->treeFilters, $this->types, $this->offset, $this->limit,
$this->platform, $this->isLoggedIn);
$this->priceFrom, $this->priceTo, $this->treeFilters, $this->types, $this->cursor, $this->limit,
$this->platform, $this->isLoggedIn);
}

public function call($options = [], $proxy = [])
Expand All @@ -57,7 +57,7 @@ private function setOptions($options)
$this->priceTo = $options['priceTo'] ?? $this->priceTo;
$this->treeFilters = $options['treeFilters'] ?? $this->treeFilters;
$this->types = $options['types'] ?? $this->types;
$this->offset = $options['offset'] ?? $this->offset;
$this->cursor = $options['cursor'] ?? $this->cursor;
$this->limit = $options['limit'] ?? $this->limit;
$this->currency = $options['currency'] ?? $this->currency;
$this->platform = $options['platform'] ?? $this->platform;
Expand Down

0 comments on commit 77cec89

Please sign in to comment.