Skip to content

Commit

Permalink
Merge pull request #3 from pushedrumex/refactor/order
Browse files Browse the repository at this point in the history
refactor: 주문 결제 리팩토링
  • Loading branch information
pushedrumex authored Apr 22, 2024
2 parents b3596e1 + 7580706 commit 3e9aeed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/prgrms/nabmart/domain/order/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Version;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
Expand All @@ -40,6 +41,9 @@ public class Order extends BaseTimeEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long orderId;

@Version
private Long version;

@Column(nullable = false)
private String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ public ResponseEntity<PaymentResponse> paySuccess(
@RequestParam("amount") Integer amount,
@LoginUser Long userId
) {
PaymentResponse paymentResponse = paymentService.processSuccessPayment(userId, uuid,
paymentKey, amount);

paymentClient.confirmPayment(uuid, paymentKey, amount);

return ResponseEntity.ok(
paymentService.processSuccessPayment(userId, uuid, paymentKey, amount));
return ResponseEntity.ok(paymentResponse);
}

@GetMapping("/toss/fail")
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
spring:
output:
ansi:
enabled: always
jpa:
hibernate:
ddl-auto: create
properties:
hibernate:
format_sql: true
show_sql: true
profiles:
include:
- local
Expand Down

0 comments on commit 3e9aeed

Please sign in to comment.