generated from pricelees/issue-pr-template
[#50] Tosspay API Mocking 서버 구현 #51
@ -1,5 +1,6 @@
|
||||
package com.sangdol.roomescape.payment.infrastructure.client
|
||||
|
||||
import io.micrometer.observation.ObservationRegistry
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||
import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder
|
||||
import org.springframework.boot.http.client.ClientHttpRequestFactorySettings
|
||||
@ -17,6 +18,7 @@ class PaymentConfig {
|
||||
@Bean
|
||||
fun tosspayClientBuilder(
|
||||
paymentProperties: PaymentProperties,
|
||||
observationRegistry: ObservationRegistry
|
||||
): RestClient.Builder {
|
||||
val settings: ClientHttpRequestFactorySettings = ClientHttpRequestFactorySettings.defaults().also {
|
||||
it.withReadTimeout(Duration.ofSeconds(paymentProperties.readTimeout.toLong()))
|
||||
@ -26,6 +28,7 @@ class PaymentConfig {
|
||||
|
||||
return RestClient.builder()
|
||||
.baseUrl(paymentProperties.apiBaseUrl)
|
||||
.observationRegistry(observationRegistry)
|
||||
.defaultHeader("Authorization", getAuthorizations(paymentProperties.confirmSecretKey))
|
||||
.requestFactory(requestFactory)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user