Skip to content

Commit e7541e8

Browse files
committed
refactor: 이미 완료된 건은 상태 변경 불가 로직 추가(회귀 방지)
1 parent 440d9d3 commit e7541e8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • apps/commerce-api/src/main/java/com/loopers/domain/payment

apps/commerce-api/src/main/java/com/loopers/domain/payment/Payment.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ private void validateConstructor(Long orderId, Long userId, Money amount, String
7979
}
8080

8181
public void completePayment(String pgTxnId) {
82+
if (this.status == PaymentStatus.PAID || this.status == PaymentStatus.CANCELLED) {
83+
return;
84+
}
8285
this.pgTxnId = pgTxnId;
8386
this.status = PaymentStatus.PAID;
8487
}

0 commit comments

Comments
 (0)