-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace DMarketAuthApi\Requests; | ||
|
||
use DMarketAuthApi\Engine\Request; | ||
use DMarketAuthApi\Interfaces\RequestInterface; | ||
|
||
class EditUserTargets extends Request implements RequestInterface | ||
{ | ||
const URL = "/exchange/v1/target/update"; | ||
|
||
private string $method = 'POST'; | ||
|
||
public function getUrl(): string | ||
{ | ||
return self::URL; | ||
} | ||
|
||
/** | ||
* @throws \SodiumException | ||
*/ | ||
public function call(string $publicKey, string $secretKey, array $postParams = [], array $proxy = []) | ||
{ | ||
return $this->dmarketHttpRequest($publicKey, $secretKey, $postParams, $proxy); | ||
} | ||
|
||
public function getRequestMethod(): string | ||
{ | ||
return $this->method; | ||
} | ||
|
||
public function getRootUrl(): string | ||
{ | ||
return "https://api.dmarket.com"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace DMarketAuthApi\Responses; | ||
|
||
use DMarketAuthApi\Interfaces\ResponseInterface; | ||
|
||
class EditUserTargets implements ResponseInterface | ||
{ | ||
private $data; | ||
|
||
public function __construct($response) | ||
{ | ||
$this->data = $this->decodeResponse($response); | ||
} | ||
|
||
public function response() | ||
{ | ||
return $this->data; | ||
} | ||
|
||
private function decodeResponse($response) | ||
{ | ||
return json_decode($response, true); | ||
} | ||
} |