Skip to content

Conversation

@kimdavid0521
Copy link
Collaborator

@kimdavid0521 kimdavid0521 commented Sep 14, 2024

iamport를 사용하여 결제 기능을 구현하였습니다.
클라이언트에서 주문 요청시 서버에서 고유 주문 번호를 생성하여 클라이언트에게 전달한 후 클라이언트는 IMP 라이브러리를 사용하여 결제 후
콜백으로 들어온 응답에 대하여 서버로 보내고 서버에서는 iamport client를 이용하여 해당 주문결제가 맞는지 확인하는 검증 과정(결제 금액 변조 검증, 결제 상태 검증)을 거친 후 결제가 되도록 구현하였습니다.

  • 결제 성공 기록입니다.
    image

@kimdavid0521 kimdavid0521 self-assigned this Sep 14, 2024
@kimdavid0521 kimdavid0521 changed the title Feat/#213 : iamport로 결제 기능 구현 Feat#213 : iamport로 결제 기능 구현 Sep 14, 2024
Copy link
Member

@MinYeongPark MinYeongPark left a 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;
Copy link
Member

Choose a reason for hiding this comment

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

BigDecimal 타입을 처음 봐서 찾아봤는데 돈을 나타내는 자료형으로는 BigDecimal 타입이 미세한 숫자의 변동을 허용하지 않아서 더 안전하군요. 덕분에 배워갑니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

😃

Comment on lines +11 to +12
@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);
Copy link
Member

Choose a reason for hiding this comment

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

중요한 건 아니고 그냥 궁금한 건데 여쭤봅니다!
jpql문을 한 라인에서 표현하는데 " " + " " 으로 분리해서 나타내신 것은 특별히 의도하신 걸까요??

제 생각에는 한 라인으로 표현한다면 그냥 하나의 " " 안에 담고,
여러 줄로 나타낼 때 분리하는 것도 좋을 것 같습니다!

Copy link
Collaborator Author

@kimdavid0521 kimdavid0521 Sep 17, 2024

Choose a reason for hiding this comment

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

복잡해서 보기 쉽게 끊어서 작성하였는데 수정하겠습니다!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants