File tree 7 files changed +31
-28
lines changed
7 files changed +31
-28
lines changed Original file line number Diff line number Diff line change 7
7
'secret_key ' => env ('TOSS_PAYMENTS_SECRET_KEY ' ),
8
8
'content_type ' => 'application/json ' ,
9
9
'accept ' => 'application/json ' ,
10
- ];
10
+ ];
Original file line number Diff line number Diff line change 10
10
class Payment extends TossPayments implements AttributeInterface
11
11
{
12
12
/**
13
- * @var string $uri
13
+ * @var string
14
14
*/
15
15
protected string $ uri ;
16
16
17
17
/**
18
- * @var string $paymentKey
18
+ * @var string
19
19
*/
20
20
protected string $ paymentKey ;
21
21
22
22
/**
23
- * @var string $orderId
23
+ * @var string
24
24
*/
25
25
protected string $ orderId ;
26
26
27
27
/**
28
- * @var int $amount
28
+ * @var int
29
29
*/
30
30
protected int $ amount ;
31
31
@@ -51,7 +51,7 @@ public function initializeUri(): static
51
51
*/
52
52
public function createEndpoint (?string $ endpoint ): string
53
53
{
54
- return $ this ->url . $ this ->uri . $ this ->start ($ endpoint );
54
+ return $ this ->url . $ this ->uri . $ this ->start ($ endpoint );
55
55
}
56
56
57
57
/**
@@ -104,14 +104,14 @@ public function confirm(): PromiseInterface|Response
104
104
*/
105
105
public function get (): PromiseInterface |Response
106
106
{
107
- return $ this ->client ->get ($ this ->createEndpoint ('/ ' . $ this ->paymentKey ));
107
+ return $ this ->client ->get ($ this ->createEndpoint ('/ ' . $ this ->paymentKey ));
108
108
}
109
109
110
110
/**
111
111
* @return PromiseInterface|Response
112
112
*/
113
113
public function order (): PromiseInterface |Response
114
114
{
115
- return $ this ->client ->get ($ this ->createEndpoint ('/orders/ ' . $ this ->orderId ));
115
+ return $ this ->client ->get ($ this ->createEndpoint ('/orders/ ' . $ this ->orderId ));
116
116
}
117
- }
117
+ }
Original file line number Diff line number Diff line change 9
9
class Transaction extends TossPayments implements AttributeInterface
10
10
{
11
11
/**
12
- * @var string $uri
12
+ * @var string
13
13
*/
14
14
protected string $ uri ;
15
15
16
16
/**
17
- * @var string $startDate
17
+ * @var string
18
18
*/
19
19
protected string $ startDate ;
20
20
21
21
/**
22
- * @var string $endDate
22
+ * @var string
23
23
*/
24
24
protected string $ endDate ;
25
25
26
26
/**
27
- * @var string $startingAfter
27
+ * @var string
28
28
*/
29
29
protected string $ startingAfter ;
30
30
@@ -55,7 +55,7 @@ public function initializeUri(): static
55
55
*/
56
56
public function createEndpoint (?string $ endpoint ): string
57
57
{
58
- return $ this ->url . $ this ->uri . $ this ->start ($ endpoint );
58
+ return $ this ->url . $ this ->uri . $ this ->start ($ endpoint );
59
59
}
60
60
61
61
/**
@@ -93,6 +93,7 @@ public function startingAfter(string $startingAfter): static
93
93
94
94
/**
95
95
* @return $this
96
+ *
96
97
* @throws LargeLimitException
97
98
*/
98
99
public function limit (int $ limit ): static
@@ -115,4 +116,4 @@ public function get()
115
116
'limit ' => $ this ->limit ,
116
117
]);
117
118
}
118
- }
119
+ }
Original file line number Diff line number Diff line change 5
5
interface AttributeInterface
6
6
{
7
7
public function __construct ();
8
+
8
9
public function initializeUri (): static ;
10
+
9
11
public function createEndpoint (?string $ endpoint ): string ;
10
- }
12
+ }
Original file line number Diff line number Diff line change 5
5
class LargeLimitException extends \Exception
6
6
{
7
7
protected $ message = 'limit 가 10000을 초과하였습니다. ' ;
8
- }
8
+ }
Original file line number Diff line number Diff line change 8
8
class TossPayments
9
9
{
10
10
/**
11
- * @var string $attribute
11
+ * @var string
12
12
*/
13
13
protected $ attribute ;
14
14
15
15
/**
16
- * @var $client
16
+ * @var
17
17
*/
18
18
protected $ client ;
19
19
20
20
/**
21
- * @var string $url
21
+ * @var string
22
22
*/
23
23
protected string $ endpoint ;
24
24
25
25
/**
26
- * @var string $version
26
+ * @var string
27
27
*/
28
28
protected string $ version ;
29
29
30
30
/**
31
- * @var string $url
31
+ * @var string
32
32
*/
33
33
protected string $ url ;
34
34
35
35
/**
36
- * @var string $clientKey
36
+ * @var string
37
37
*/
38
38
protected string $ clientKey ;
39
39
40
40
/**
41
- * @var string $secretKey
41
+ * @var string
42
42
*/
43
43
protected string $ secretKey ;
44
44
45
45
/**
46
- * @var array $headers
46
+ * @var array
47
47
*/
48
48
protected array $ headers = [];
49
49
@@ -93,7 +93,7 @@ protected function initializeApiUrl(): static
93
93
{
94
94
$ this ->endpoint = config ('toss-payments.endpoint ' );
95
95
$ this ->version = config ('toss-payments.version ' );
96
- $ this ->url = $ this ->endpoint . '/ ' . $ this ->version ;
96
+ $ this ->url = $ this ->endpoint . '/ ' . $ this ->version ;
97
97
98
98
return $ this ;
99
99
}
@@ -115,7 +115,7 @@ protected function initializeKeys(): static
115
115
protected function initializeHeaders (): static
116
116
{
117
117
$ this ->headers = [
118
- 'Authorization ' => 'Basic ' . base64_encode ($ this ->secretKey . ': ' ),
118
+ 'Authorization ' => 'Basic ' . base64_encode ($ this ->secretKey . ': ' ),
119
119
'Content-Type ' => 'application/json ' ,
120
120
];
121
121
Original file line number Diff line number Diff line change @@ -32,4 +32,4 @@ public function boot(): void
32
32
__DIR__ ."/../config/ {$ this ->name }.php " => config_path ($ this ->name .'.php ' ),
33
33
], 'config ' );
34
34
}
35
- }
35
+ }
You can’t perform that action at this time.
0 commit comments