Skip to content

Commit 40287e8

Browse files
authored
Merge pull request #27 from ranjanrak/update-loginUrl
chore: update kiteconnect login URL
2 parents 3c77a64 + 398a40b commit 40287e8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/KiteConnect.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,16 @@ class KiteConnect
123123

124124
public const VERSION = "3.2.0";
125125

126+
// Kite connect header version
127+
private $kiteVersion = "3";
128+
126129
// Default root API endpoint. It's possible to
127130
// override this by passing the `root` parameter during initialisation.
128131
/** @var String */
129132
private $baseUrl = "https://api.kite.trade";
130133

131134
/** @var String */
132-
private $loginUrl = "https://kite.trade/connect/login";
135+
private $loginUrl = "https://kite.zerodha.com/connect/login";
133136

134137
/** @var array */
135138
private static $dateFields = ["order_timestamp", "exchange_timestamp", "created", "last_instalment", "fill_timestamp", "timestamp", "last_trade_time"];
@@ -287,7 +290,7 @@ public function setAccessToken(string $accessToken): void
287290
*/
288291
public function getLoginURL(): string
289292
{
290-
return "{$this->loginUrl}?api_key={$this->apiKey}&v=3";
293+
return "{$this->loginUrl}?api_key={$this->apiKey}&v={$this->kiteVersion}";
291294
}
292295

293296
/**

tests/KiteConnectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function test_login_url_is_generated_correctly(): void
2424
{
2525
$kiteConnect = new KiteConnect('token');
2626
$actualLoginUrl = $kiteConnect->getLoginURL();
27-
$expectedLoginUrl = 'https://kite.trade/connect/login?api_key=token&v=3';
27+
$expectedLoginUrl = 'https://kite.zerodha.com/connect/login?api_key=token&v=3';
2828
$this->assertEquals($expectedLoginUrl, $actualLoginUrl);
2929
}
3030

0 commit comments

Comments
 (0)