Skip to content

Commit

Permalink
adjust constant
Browse files Browse the repository at this point in the history
  • Loading branch information
eltinMeli committed Sep 13, 2023
1 parent a61bca5 commit bf33271
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/MercadoPago/Client/MerchantOrder/MerchantOrderClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
/** Client responsible for performing merchant order actions. */
final class MerchantOrderClient extends MercadoPagoClient
{
private static $URL = "/merchant_orders";
private const URL = "/merchant_orders";

private static $URL_WITH_ID = "/merchant_orders/%s";
private const URL_WITH_ID = "/merchant_orders/%s";

private static $URL_SEARCH = "/merchant_orders/search";
private const URL_SEARCH = "/merchant_orders/search";

/** Default constructor. Uses the default http client used by the SDK. */
public function __construct()
Expand All @@ -36,7 +36,7 @@ public function __construct()
*/
public function create(array $request, ?MPRequestOptions $request_options = null): MerchantOrder
{
$response = parent::send(self::$URL, HttpMethod::POST, json_encode($request), null, $request_options);
$response = parent::send(self::URL, HttpMethod::POST, json_encode($request), null, $request_options);
$result = Serializer::deserializeFromJson(MerchantOrder::class, $response->getContent());
$result->setResponse($response);
return $result;
Expand All @@ -52,7 +52,7 @@ public function create(array $request, ?MPRequestOptions $request_options = null
*/
public function get(int $id, ?MPRequestOptions $request_options = null): MerchantOrder
{
$response = parent::send(sprintf(self::$URL_WITH_ID, strval($id)), HttpMethod::GET, null, null, $request_options);
$response = parent::send(sprintf(self::URL_WITH_ID, strval($id)), HttpMethod::GET, null, null, $request_options);
$result = Serializer::deserializeFromJson(MerchantOrder::class, $response->getContent());
$result->setResponse($response);
return $result;
Expand All @@ -69,7 +69,7 @@ public function get(int $id, ?MPRequestOptions $request_options = null): Merchan
*/
public function update(int $id, array $request, ?MPRequestOptions $request_options = null): MerchantOrder
{
$response = parent::send(sprintf(self::$URL_WITH_ID, strval($id)), HttpMethod::PUT, json_encode($request), null, $request_options);
$response = parent::send(sprintf(self::URL_WITH_ID, strval($id)), HttpMethod::PUT, json_encode($request), null, $request_options);
$result = Serializer::deserializeFromJson(MerchantOrder::class, $response->getContent());
$result->setResponse($response);
return $result;
Expand All @@ -86,7 +86,7 @@ public function update(int $id, array $request, ?MPRequestOptions $request_optio
public function search(MPSearchRequest $request, ?MPRequestOptions $request_options = null): MerchantOrderSearch
{
$query_params = isset($request) ? $request->getParameters() : null;
$response = parent::send(self::$URL_SEARCH, HttpMethod::GET, null, $query_params, $request_options);
$response = parent::send(self::URL_SEARCH, HttpMethod::GET, null, $query_params, $request_options);
$result = Serializer::deserializeFromJson(MerchantOrderSearch::class, $response->getContent());
$result->setResponse($response);
return $result;
Expand Down

0 comments on commit bf33271

Please sign in to comment.