-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat : 결제 취소 관련 기능 개발 (#70) #95
Conversation
|
||
@JsonCreator | ||
static TossPaymentMethod findValue(String code) { | ||
return Arrays.stream(TossPaymentMethod.values()) | ||
.filter(PaymentMethod -> PaymentMethod.getKr().equals(code)) | ||
.findFirst() | ||
.orElseThrow(() -> PaymentsEnumNotMatchException.EXCEPTION); | ||
} | ||
} |
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.
이부분은 토스페이먼츠로 요청받아서 응답받는 리스폰트 디티오부분인데
jsonCreator 가 역직렬화 하는 어노테이션인데
토스에서 값을 "카드" 이런식으로줘서
위처럼 필터링 돌려서 역직렬화 하는 방식썻습니다!!
easyPay, card 코드도 마찬가지.
private final Long amount; | ||
|
||
@Schema(description = "결제금액") | ||
private final Money amount; | ||
|
||
public static CreateOrderResponse from(Order order, Profile profile) { | ||
return CreateOrderResponse.builder() | ||
.customerEmail(profile.getEmail()) | ||
.customerName(profile.getName()) | ||
.orderName(order.getOrderName()) | ||
.orderId(order.getUuid()) | ||
.amount(order.getTotalPaymentPrice().longValue()) | ||
.amount(order.getTotalPaymentPrice()) | ||
.build(); | ||
} |
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.
이런식으로
응답에 Money 타입을 그대로 쓰세요!
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.
넵
@@ -15,16 +16,19 @@ public class CreateCartResponse { | |||
private final List<CartItemResponse> items; | |||
|
|||
// 금액 | |||
private final String totalPrice; | |||
private final Money totalPrice; |
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.
금액 관련 정보들 Money로 매핑하겠습니다 좋네요
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class CreateOrderResponse { | ||
@Schema(description = "UUId") |
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.
저 스키마 추가를 까먹었네요 감사합니다
public OrderResponse execute(String orderUuid) { | ||
return orderMapper.toOrderResponse(orderUuid); |
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.
mapper 활용 좋아요
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.
엄청난 속도군여 LGTM 🌟
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.
LGTM 🌟
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
개요
작업사항
관리자 취소일경우 event_id 가 필요한데
민준이처럼
/api/v1/admin/events/{event_id}/order/{order_id}/cancel
뭐이렇게 url가져가고 useCase 만 저길로 옮기면되니깐!
괜찮을것같긴하네요
변경로직