Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POM-84] feat: 주문 거절 시 결제 취소 #30

Merged
merged 11 commits into from
Sep 14, 2023
Merged

Conversation

hyeon-z
Copy link
Collaborator

@hyeon-z hyeon-z commented Sep 14, 2023

📌 구현 설명

주문 거절 시 결제 취소

👩‍💻 요구 사항과 구현 내용

주문이 거절되는 경우 해당 결제 건의 statusCANCELED로 변경한다.

@hyeon-z hyeon-z added the FEAT label Sep 14, 2023
@hyeon-z hyeon-z self-assigned this Sep 14, 2023
@hyeon-z hyeon-z changed the title [POM-84] 주문 거절 시 결제 취소 [POM-84] feat: 주문 거절 시 결제 취소 Sep 14, 2023
Copy link
Collaborator

@juno-junho juno-junho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 28 to 33
Payment canceled = Payment.builder()
.id(paymentId)
.amount(payment.getAmount())
.provider(payment.getProvider())
.status(PaymentStatus.CANCELLED)
.build();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

도메인 내부에서 작업하는게 좋아보이네요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@choi5798 choi5798 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

public Payment create(Payment payment) {
return paymentRepository.save(payment);
}


public Payment canceled(Long paymentId) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

메소드이름이 동사 과거형인게 조금 부자연스러워 보여요. 현재형으로 바꾸거나 목적어를 추가하는 건 어떠신가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public void successCancelPayment() {
// given
Payment saved = new Payment(1L, 1000, PaymentStatus.COMPLETE, PGType.TOSS);
Payment canceled = new Payment(1L, 1000, PaymentStatus.CANCELLED, PGType.TOSS);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status의 cancelled 와 변수명 canceled을 통일하면 좋을 것 같아요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@beomukim beomukim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍣

@hyeon-z hyeon-z merged commit 4e0a3f9 into dev Sep 14, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants