Skip to content

Commit de587b9

Browse files
author
pobi
committed
feat(payment): create Payment object and find Payment by id
1 parent db11b92 commit de587b9

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package nextstep.payments.domain;
2+
3+
import java.time.LocalDateTime;
4+
5+
public class Payment {
6+
private String id;
7+
8+
// 결제한 강의 아이디
9+
private Long sessionId;
10+
11+
// 결제한 사용자 아이디
12+
private Long nsUserId;
13+
14+
// 결제 금액
15+
private Long amount;
16+
17+
private LocalDateTime createdAt;
18+
19+
public Payment() {
20+
}
21+
22+
public Payment(String id, Long sessionId, Long nsUserId, Long amount) {
23+
this.id = id;
24+
this.sessionId = sessionId;
25+
this.nsUserId = nsUserId;
26+
this.amount = amount;
27+
this.createdAt = LocalDateTime.now();
28+
}
29+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package nextstep.payments.service;
2+
3+
import nextstep.payments.domain.Payment;
4+
5+
public class PaymentService {
6+
public Payment payment(String id) {
7+
// PG사 API를 통해 id에 해당하는 결제 정보를 반환
8+
return new Payment();
9+
}
10+
}

0 commit comments

Comments
 (0)