Skip to content

Commit

Permalink
Refactor DirectBilling and SMS Traits to use string type for serviceI…
Browse files Browse the repository at this point in the history
…d and transactionId parameters
  • Loading branch information
DarkGL committed Apr 26, 2023
1 parent 58be52f commit 769e1c1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "simpaypl/simpay",
"description": "Official SimPay API",
"type": "library",
"version": "2.1.1",
"version": "2.2.0",
"license": "MIT",
"minimum-stability": "stable",
"require": {
Expand Down
2 changes: 1 addition & 1 deletion lib/DirectBilling/Traits/CalculateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait CalculateTrait
/**
* @return mixed
*/
public function calculate(int $serviceId, float $amount)
public function calculate(string $serviceId, float $amount)
{
return $this->guzzle->request('GET', '/directbilling/'.$serviceId.'/calculate', [
'amount' => $amount,
Expand Down
2 changes: 1 addition & 1 deletion lib/DirectBilling/Traits/ServicesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getServices(int $page = 1, int $limit = 15)
/**
* @return mixed
*/
public function getService(int $serviceId)
public function getService(string $serviceId)
{
return $this->guzzle->request('GET', '/directbilling/'.$serviceId);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/DirectBilling/Traits/TransactionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait TransactionsTrait
/**
* @return mixed
*/
public function getTransactions(int $serviceId, int $page = 1, int $limit = 15)
public function getTransactions(string $serviceId, int $page = 1, int $limit = 15)
{
return $this->guzzle->request('GET', '/directbilling/'.$serviceId.'/transactions', [
'page' => $page,
Expand All @@ -18,7 +18,7 @@ public function getTransactions(int $serviceId, int $page = 1, int $limit = 15)
/**
* @return mixed
*/
public function getTransaction(int $serviceId, string $transactionId)
public function getTransaction(string $serviceId, string $transactionId)
{
return $this->guzzle->request('GET', '/directbilling/'.$serviceId.'/transactions/'.$transactionId);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Sms/Traits/ServicesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public function getServices(int $page = 1, int $limit = 15)
/**
* @return mixed
*/
public function getService(int $serviceId)
public function getService(string $serviceId)
{
return $this->guzzle->request('GET', '/sms/'.$serviceId);
}

/**
* @return mixed
*/
public function getServiceNumbers(int $serviceId, int $page = 1, int $limit = 15)
public function getServiceNumbers(string $serviceId, int $page = 1, int $limit = 15)
{
return $this->guzzle->request('GET', '/sms/'.$serviceId.'/numbers', [
'page' => $page,
Expand All @@ -37,15 +37,15 @@ public function getServiceNumbers(int $serviceId, int $page = 1, int $limit = 15
/**
* @return mixed
*/
public function getServiceNumber(int $serviceId, int $number)
public function getServiceNumber(string $serviceId, int $number)
{
return $this->guzzle->request('GET', '/sms/'.$serviceId.'/numbers/'.$number);
}

/**
* @return mixed
*/
public function getSmsCode(int $serviceId, string $code, int $number = null)
public function getSmsCode(string $serviceId, string $code, int $number = null)
{
return $this->guzzle->request('POST', '/sms/'.$serviceId, [
'code' => $code,
Expand Down
4 changes: 2 additions & 2 deletions lib/Sms/Traits/TransactionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait TransactionsTrait
/**
* @return mixed
*/
public function getTransactions(int $serviceId, int $page = 1, int $limit = 15)
public function getTransactions(string $serviceId, int $page = 1, int $limit = 15)
{
return $this->guzzle->request('GET', '/sms/'.$serviceId.'/transactions', [
'page' => $page,
Expand All @@ -18,7 +18,7 @@ public function getTransactions(int $serviceId, int $page = 1, int $limit = 15)
/**
* @return mixed
*/
public function getTransaction(int $serviceId, int $transactionId)
public function getTransaction(string $serviceId, int $transactionId)
{
return $this->guzzle->request('GET', '/sms/'.$serviceId.'/transactions/'.$transactionId);
}
Expand Down
Empty file removed lib/composer.json
Empty file.

0 comments on commit 769e1c1

Please sign in to comment.