Skip to content

Commit c69c820

Browse files
committed
[WP-69] Change endpoint to validate credentials
1 parent 186e581 commit c69c820

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Client.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ public function __construct($user = null, $password = null, $endpoint = null, $d
3939
$this->_user_agent = Helper::notNull(self::$user_agent, 'cURL php ' . phpversion());
4040
}
4141

42-
public function isValidAuth()
42+
public function isValidAuth($merchant = '')
4343
{
44-
$this->initCurl($this->_endpoint . '/orders');
44+
$this->initCurl(
45+
$this->_endpoint .
46+
'/merchants' .
47+
$merchant?'/'.$merchant:'' .
48+
'/credentials'
49+
);
4550
curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, 'GET');
4651
$this->sendRequest();
47-
return $this->status != 401;
52+
$this->dealWithResponse();
53+
return $this->succeeded();
4854
}
4955

5056
public function startSolicitation($order)

0 commit comments

Comments
 (0)