Skip to content

Commit 1c73ad6

Browse files
committed
[client] update base URL
1 parent 474ae4d commit 1c73ad6

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SMS Gateway for Android™ PHP API Client
22

3-
This is a PHP client library for interfacing with the [SMS Gateway for Android](https://sms.capcom.me) API.
3+
This is a PHP client library for interfacing with the [SMS Gateway for Android](https://sms-gate.app) API.
44

55
## Requirements
66

src/Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use RuntimeException;
1414

1515
class Client {
16-
public const DEFAULT_URL = 'https://sms.capcom.me/api/3rdparty/v1';
16+
public const DEFAULT_URL = 'https://api.sms-gate.app/3rdparty/v1';
1717
public const USER_AGENT_TEMPLATE = 'android-sms-gateway/2.0 (client; php %s)';
1818

1919
protected string $basicAuth;
@@ -42,7 +42,7 @@ public function __construct(
4242
}
4343

4444
public function Send(Message $message): MessageState {
45-
$path = '/message';
45+
$path = '/messages';
4646

4747
if (isset($this->encryptor)) {
4848
$message = $message->Encrypt($this->encryptor);
@@ -67,7 +67,7 @@ public function Send(Message $message): MessageState {
6767
}
6868

6969
public function GetState(string $id): MessageState {
70-
$path = '/message/' . $id;
70+
$path = '/messages/' . $id;
7171

7272
$response = $this->sendRequest(
7373
'GET',

tests/ClientTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use AndroidSmsGateway\Client;
77
use AndroidSmsGateway\Domain\Message;
88
use AndroidSmsGateway\Domain\MessageState;
9-
use AndroidSmsGateway\Domain\RecipientState;
109
use AndroidSmsGateway\Enums\ProcessState;
1110
use Http\Discovery\Psr17FactoryDiscovery;
1211
use Http\Mock\Client as MockClient;
@@ -47,7 +46,7 @@ public function testSend(): void {
4746
$messageState = $this->client->Send($messageMock);
4847
$req = $this->mockClient->getLastRequest();
4948
$this->assertEquals('POST', $req->getMethod());
50-
$this->assertEquals('/api/3rdparty/v1/message', $req->getUri()->getPath());
49+
$this->assertEquals('/3rdparty/v1/messages', $req->getUri()->getPath());
5150
$this->assertEquals(
5251
'Basic ' . base64_encode(self::MOCK_LOGIN . ':' . self::MOCK_PASSWORD),
5352
$req->getHeaderLine('Authorization')
@@ -77,7 +76,7 @@ public function testGetState(): void {
7776
$messageState = $this->client->GetState('123');
7877
$req = $this->mockClient->getLastRequest();
7978
$this->assertEquals('GET', $req->getMethod());
80-
$this->assertEquals('/api/3rdparty/v1/message/123', $req->getUri()->getPath());
79+
$this->assertEquals('/3rdparty/v1/messages/123', $req->getUri()->getPath());
8180
$this->assertEquals(
8281
'Basic ' . base64_encode(self::MOCK_LOGIN . ':' . self::MOCK_PASSWORD),
8382
$req->getHeaderLine('Authorization')

0 commit comments

Comments
 (0)