-
Notifications
You must be signed in to change notification settings - Fork 2
Feat#213 : iamport로 결제 기능 구현 #214
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
base: develop
Are you sure you want to change the base?
Conversation
MinYeongPark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다! 결제 관련 구현 코드는 처음 보는데 덕분에 배워갑니다!
| private Product product; // POINT_1000, POINT_2000 일단 두개 설정해놨습니다. | ||
|
|
||
| @Column(nullable = false) | ||
| private BigDecimal price; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BigDecimal 타입을 처음 봐서 찾아봤는데 돈을 나타내는 자료형으로는 BigDecimal 타입이 미세한 숫자의 변동을 허용하지 않아서 더 안전하군요. 덕분에 배워갑니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😃
| @Query("SELECT o FROM Order o " + "LEFT JOIN FETCH o.payment p " + "LEFT JOIN FETCH o.user m " + "WHERE o.orderUid = :orderUid") | ||
| Optional<Order> findOrderAndPaymentAndMember(@Param("orderUid") String orderUid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중요한 건 아니고 그냥 궁금한 건데 여쭤봅니다!
jpql문을 한 라인에서 표현하는데 " " + " " 으로 분리해서 나타내신 것은 특별히 의도하신 걸까요??
제 생각에는 한 라인으로 표현한다면 그냥 하나의 " " 안에 담고,
여러 줄로 나타낼 때 분리하는 것도 좋을 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
복잡해서 보기 쉽게 끊어서 작성하였는데 수정하겠습니다!!
iamport를 사용하여 결제 기능을 구현하였습니다.
클라이언트에서 주문 요청시 서버에서 고유 주문 번호를 생성하여 클라이언트에게 전달한 후 클라이언트는 IMP 라이브러리를 사용하여 결제 후
콜백으로 들어온 응답에 대하여 서버로 보내고 서버에서는 iamport client를 이용하여 해당 주문결제가 맞는지 확인하는 검증 과정(결제 금액 변조 검증, 결제 상태 검증)을 거친 후 결제가 되도록 구현하였습니다.