diff --git a/config/toss-payments.php b/config/toss-payments.php index 72cd81a..c0f6e1c 100644 --- a/config/toss-payments.php +++ b/config/toss-payments.php @@ -7,4 +7,4 @@ 'secret_key' => env('TOSS_PAYMENTS_SECRET_KEY'), 'content_type' => 'application/json', 'accept' => 'application/json', -]; \ No newline at end of file +]; diff --git a/src/Attributes/Payment.php b/src/Attributes/Payment.php index ad0583f..f859884 100644 --- a/src/Attributes/Payment.php +++ b/src/Attributes/Payment.php @@ -10,22 +10,22 @@ class Payment extends TossPayments implements AttributeInterface { /** - * @var string $uri + * @var string */ protected string $uri; /** - * @var string $paymentKey + * @var string */ protected string $paymentKey; /** - * @var string $orderId + * @var string */ protected string $orderId; /** - * @var int $amount + * @var int */ protected int $amount; @@ -51,7 +51,7 @@ public function initializeUri(): static */ public function createEndpoint(?string $endpoint): string { - return $this->url . $this->uri . $this->start($endpoint); + return $this->url.$this->uri.$this->start($endpoint); } /** @@ -104,7 +104,7 @@ public function confirm(): PromiseInterface|Response */ public function get(): PromiseInterface|Response { - return $this->client->get($this->createEndpoint('/' . $this->paymentKey)); + return $this->client->get($this->createEndpoint('/'.$this->paymentKey)); } /** @@ -112,6 +112,6 @@ public function get(): PromiseInterface|Response */ public function order(): PromiseInterface|Response { - return $this->client->get($this->createEndpoint('/orders/' . $this->orderId)); + return $this->client->get($this->createEndpoint('/orders/'.$this->orderId)); } -} \ No newline at end of file +} diff --git a/src/Attributes/Transaction.php b/src/Attributes/Transaction.php index 9b5736c..08972cf 100644 --- a/src/Attributes/Transaction.php +++ b/src/Attributes/Transaction.php @@ -9,22 +9,22 @@ class Transaction extends TossPayments implements AttributeInterface { /** - * @var string $uri + * @var string */ protected string $uri; /** - * @var string $startDate + * @var string */ protected string $startDate; /** - * @var string $endDate + * @var string */ protected string $endDate; /** - * @var string $startingAfter + * @var string */ protected string $startingAfter; @@ -55,7 +55,7 @@ public function initializeUri(): static */ public function createEndpoint(?string $endpoint): string { - return $this->url . $this->uri . $this->start($endpoint); + return $this->url.$this->uri.$this->start($endpoint); } /** @@ -93,6 +93,7 @@ public function startingAfter(string $startingAfter): static /** * @return $this + * * @throws LargeLimitException */ public function limit(int $limit): static @@ -115,4 +116,4 @@ public function get() 'limit' => $this->limit, ]); } -} \ No newline at end of file +} diff --git a/src/Contracts/AttributeInterface.php b/src/Contracts/AttributeInterface.php index 3eea436..8b86f3b 100644 --- a/src/Contracts/AttributeInterface.php +++ b/src/Contracts/AttributeInterface.php @@ -5,6 +5,8 @@ interface AttributeInterface { public function __construct(); + public function initializeUri(): static; + public function createEndpoint(?string $endpoint): string; -} \ No newline at end of file +} diff --git a/src/Exceptions/LargeLimitException.php b/src/Exceptions/LargeLimitException.php index fc79dad..2a4f26f 100644 --- a/src/Exceptions/LargeLimitException.php +++ b/src/Exceptions/LargeLimitException.php @@ -5,4 +5,4 @@ class LargeLimitException extends \Exception { protected $message = 'limit 가 10000을 초과하였습니다.'; -} \ No newline at end of file +} diff --git a/src/TossPayments.php b/src/TossPayments.php index 9b140ad..f63cd44 100644 --- a/src/TossPayments.php +++ b/src/TossPayments.php @@ -8,42 +8,42 @@ class TossPayments { /** - * @var string $attribute + * @var string */ protected $attribute; /** - * @var $client + * @var */ protected $client; /** - * @var string $url + * @var string */ protected string $endpoint; /** - * @var string $version + * @var string */ protected string $version; /** - * @var string $url + * @var string */ protected string $url; /** - * @var string $clientKey + * @var string */ protected string $clientKey; /** - * @var string $secretKey + * @var string */ protected string $secretKey; /** - * @var array $headers + * @var array */ protected array $headers = []; @@ -93,7 +93,7 @@ protected function initializeApiUrl(): static { $this->endpoint = config('toss-payments.endpoint'); $this->version = config('toss-payments.version'); - $this->url = $this->endpoint . '/' . $this->version; + $this->url = $this->endpoint.'/'.$this->version; return $this; } @@ -115,7 +115,7 @@ protected function initializeKeys(): static protected function initializeHeaders(): static { $this->headers = [ - 'Authorization' => 'Basic ' . base64_encode($this->secretKey . ':'), + 'Authorization' => 'Basic '.base64_encode($this->secretKey.':'), 'Content-Type' => 'application/json', ]; diff --git a/src/TossPaymentsServiceProvider.php b/src/TossPaymentsServiceProvider.php index 14efdf2..0b09af7 100644 --- a/src/TossPaymentsServiceProvider.php +++ b/src/TossPaymentsServiceProvider.php @@ -32,4 +32,4 @@ public function boot(): void __DIR__."/../config/{$this->name}.php" => config_path($this->name.'.php'), ], 'config'); } -} \ No newline at end of file +}