From 4885b78aa39373f3a41ed22dc33c03dbbe955e77 Mon Sep 17 00:00:00 2001 From: kang Date: Tue, 15 Oct 2024 16:50:08 +0900 Subject: [PATCH] feat: send refund admin msg --- src/main/java/co/orange/ddanzi/service/PaymentService.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/co/orange/ddanzi/service/PaymentService.java b/src/main/java/co/orange/ddanzi/service/PaymentService.java index 49e8c43..8bc4346 100644 --- a/src/main/java/co/orange/ddanzi/service/PaymentService.java +++ b/src/main/java/co/orange/ddanzi/service/PaymentService.java @@ -14,7 +14,6 @@ import co.orange.ddanzi.domain.product.Product; import co.orange.ddanzi.domain.product.enums.ItemStatus; import co.orange.ddanzi.domain.user.User; -import co.orange.ddanzi.domain.user.enums.FcmCase; import co.orange.ddanzi.dto.payment.*; import co.orange.ddanzi.global.jwt.AuthUtils; import co.orange.ddanzi.repository.*; @@ -126,7 +125,7 @@ else if(payment.getPayStatus().equals(PayStatus.PAID)){ log.info("Payment is paid!!"); item.updateStatus(ItemStatus.CLOSED); product.updateStock(product.getStock() - 1); - fcmService.sendMessageToAdmin(FcmCase.C2); + fcmService.sendMessageToAdmins("⚠️관리자 알림: 구매실행", "결제가 실행되었습니다. orderId:" + order.getId()); } historyService.createPaymentHistory(buyer, payment); @@ -206,10 +205,10 @@ public void refundPayment(User user, Order order, String reason){ RestTemplate restTemplate = new RestTemplate(); restTemplate.postForObject(url, entity, String.class); log.info("결제 취소 api 호출"); - fcmService.sendMessageToAdmin(FcmCase.C3); + fcmService.sendMessageToAdmins("⚠️관리자 알림: 환불실행", "중복 결제로 인해 환불되었습니다. orderId:" + order.getId()); }catch (Exception e){ log.info("환불 실패"); - fcmService.sendMessageToAdmin(FcmCase.C5); + fcmService.sendMessageToAdmins("⚠️관리자 알림: 환불 실패", "환불에 실패했습니다. orderId:" + order.getId()); } }