Skip to content

Commit 769e1c1

Browse files
committed
Refactor DirectBilling and SMS Traits to use string type for serviceId and transactionId parameters
1 parent 58be52f commit 769e1c1

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "simpaypl/simpay",
33
"description": "Official SimPay API",
44
"type": "library",
5-
"version": "2.1.1",
5+
"version": "2.2.0",
66
"license": "MIT",
77
"minimum-stability": "stable",
88
"require": {

lib/DirectBilling/Traits/CalculateTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait CalculateTrait
77
/**
88
* @return mixed
99
*/
10-
public function calculate(int $serviceId, float $amount)
10+
public function calculate(string $serviceId, float $amount)
1111
{
1212
return $this->guzzle->request('GET', '/directbilling/'.$serviceId.'/calculate', [
1313
'amount' => $amount,

lib/DirectBilling/Traits/ServicesTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function getServices(int $page = 1, int $limit = 15)
1818
/**
1919
* @return mixed
2020
*/
21-
public function getService(int $serviceId)
21+
public function getService(string $serviceId)
2222
{
2323
return $this->guzzle->request('GET', '/directbilling/'.$serviceId);
2424
}

lib/DirectBilling/Traits/TransactionsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait TransactionsTrait
77
/**
88
* @return mixed
99
*/
10-
public function getTransactions(int $serviceId, int $page = 1, int $limit = 15)
10+
public function getTransactions(string $serviceId, int $page = 1, int $limit = 15)
1111
{
1212
return $this->guzzle->request('GET', '/directbilling/'.$serviceId.'/transactions', [
1313
'page' => $page,
@@ -18,7 +18,7 @@ public function getTransactions(int $serviceId, int $page = 1, int $limit = 15)
1818
/**
1919
* @return mixed
2020
*/
21-
public function getTransaction(int $serviceId, string $transactionId)
21+
public function getTransaction(string $serviceId, string $transactionId)
2222
{
2323
return $this->guzzle->request('GET', '/directbilling/'.$serviceId.'/transactions/'.$transactionId);
2424
}

lib/Sms/Traits/ServicesTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ public function getServices(int $page = 1, int $limit = 15)
1818
/**
1919
* @return mixed
2020
*/
21-
public function getService(int $serviceId)
21+
public function getService(string $serviceId)
2222
{
2323
return $this->guzzle->request('GET', '/sms/'.$serviceId);
2424
}
2525

2626
/**
2727
* @return mixed
2828
*/
29-
public function getServiceNumbers(int $serviceId, int $page = 1, int $limit = 15)
29+
public function getServiceNumbers(string $serviceId, int $page = 1, int $limit = 15)
3030
{
3131
return $this->guzzle->request('GET', '/sms/'.$serviceId.'/numbers', [
3232
'page' => $page,
@@ -37,15 +37,15 @@ public function getServiceNumbers(int $serviceId, int $page = 1, int $limit = 15
3737
/**
3838
* @return mixed
3939
*/
40-
public function getServiceNumber(int $serviceId, int $number)
40+
public function getServiceNumber(string $serviceId, int $number)
4141
{
4242
return $this->guzzle->request('GET', '/sms/'.$serviceId.'/numbers/'.$number);
4343
}
4444

4545
/**
4646
* @return mixed
4747
*/
48-
public function getSmsCode(int $serviceId, string $code, int $number = null)
48+
public function getSmsCode(string $serviceId, string $code, int $number = null)
4949
{
5050
return $this->guzzle->request('POST', '/sms/'.$serviceId, [
5151
'code' => $code,

lib/Sms/Traits/TransactionsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait TransactionsTrait
77
/**
88
* @return mixed
99
*/
10-
public function getTransactions(int $serviceId, int $page = 1, int $limit = 15)
10+
public function getTransactions(string $serviceId, int $page = 1, int $limit = 15)
1111
{
1212
return $this->guzzle->request('GET', '/sms/'.$serviceId.'/transactions', [
1313
'page' => $page,
@@ -18,7 +18,7 @@ public function getTransactions(int $serviceId, int $page = 1, int $limit = 15)
1818
/**
1919
* @return mixed
2020
*/
21-
public function getTransaction(int $serviceId, int $transactionId)
21+
public function getTransaction(string $serviceId, int $transactionId)
2222
{
2323
return $this->guzzle->request('GET', '/sms/'.$serviceId.'/transactions/'.$transactionId);
2424
}

lib/composer.json

Whitespace-only changes.

0 commit comments

Comments
 (0)