<aside>

๐Ÿ“Œย ์‚ฌ์šฉ๋ฒ•

โœ…ย ์„œ๋ฒ„์—์„œ ์„œ๋ฒ„๋กœ ์š”์ฒญํ•˜๋Š” ๊ตฌ์กฐ

๊ฒฐ์ œ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ์š”์ฒญํ•œ ์„œ๋ฒ„(์ž์‹ ์˜ ์„œ๋ฒ„)์— ๊ฒฐ์ œ ์™„๋ฃŒ ์‘๋‹ต์ด ๊ฐ€์„œ ์ž์‹ ์˜ ํด๋ผ์ด์–ธํŠธ์— ์‘๋‹ต


๐Ÿ˜ย API ๋ช…์„ธ์„œ

Payment API


๐Ÿ’ปย ์ฝ”๋“œ

1๏ธโƒฃย OpenFeign

PlantifyPaymentServiceClient

@FeignClient(name = "plantify-payment-service", url = "${}")
public interface PlantifyPaymentServiceClient {
	
		@PostMapping("/v1/pay/payment")
    ResponseEntity<String> payment(@RequestBody TransactionRequest request);
    
    @GetMapping("/v1/auth/users/seacrh")
    ResponseEntity<Long> getUserId(@RequestParam String username);
    
    @GetMapping("/v1/pay/settlements/external")
    ResponseEntity<ExternalSettlementResponse> getSettlementByOrderId(@RequestParam String orderId)
}

2๏ธโƒฃย DTO

TransactionRequest

public record TransactionRequest(
        Long userId,
        Long sellerId,
        String orderName,
        Long amount,
        String redirectUri
) {
}

ExternalSettlementResponse

public record ExternalSettlementResponse(
        String orderId,
        String orderName,
        LocalDateTime createdAt,
        Long amount
)

3๏ธโƒฃย Controller