Skip to content

Commit

Permalink
♻️ : 카드 삭제 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
imenuuu committed Nov 13, 2023
1 parent 166ab08 commit 2e07343
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.example.matchcommon.exception.BaseException;
import com.example.matchdomain.common.model.Status;
import com.example.matchdomain.donation.adaptor.RegularPaymentAdaptor;
import com.example.matchdomain.donation.adaptor.RequestFailedHistoryAdapter;
import com.example.matchdomain.donation.entity.*;
import com.example.matchdomain.donation.entity.enums.CardAbleStatus;
import com.example.matchdomain.donation.entity.enums.DonationStatus;
Expand Down Expand Up @@ -56,6 +57,7 @@ public class OrderService {
private final RegularPaymentAdaptor regularPaymentAdaptor;
private final UserCardAdaptor userCardAdaptor;
private final DonationHistoryService donationHistoryService;
private final RequestFailedHistoryAdapter failedHistoryAdapter;

@Transactional
public List<OrderRes.UserBillCard> getUserBillCard(Long userId) {
Expand Down Expand Up @@ -198,6 +200,7 @@ public PortOneBillResponse postCard(User user, OrderReq.RegistrationCard registr
private void cancelRegularPayment(List<RegularPayment> regularPayments) {
for(RegularPayment regularPayment : regularPayments){
regularPayment.setRegularPayStatus(RegularPayStatus.USER_CANCEL);
failedHistoryAdapter.deleteByRegularPaymentId(regularPayment.getId());
}
regularPaymentRepository.saveAll(regularPayments);
}
Expand Down

0 comments on commit 2e07343

Please sign in to comment.