Skip to content

Commit

Permalink
fix: 토스 승인 API 요청 시 Basic 인증 헤더로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kmebin committed Nov 29, 2023
1 parent 3408228 commit 0d63bd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void init() {
.baseUrl(config.baseUrl())
.defaultHeaders(headers -> {
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
headers.setBearerAuth(Base64.getEncoder().encodeToString(config.secretKey().getBytes()));
headers.setBasicAuth(Base64.getEncoder().encodeToString(config.secretKey().getBytes()));
})
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.moabam.api.domain.payment.Payment;
import com.moabam.api.domain.payment.PaymentStatus;
import com.moabam.api.domain.payment.repository.PaymentRepository;
import com.moabam.api.domain.payment.repository.PaymentSearchRepository;
import com.moabam.api.domain.product.Product;
import com.moabam.api.domain.product.repository.ProductRepository;
import com.moabam.api.dto.payment.ConfirmPaymentRequest;
Expand Down Expand Up @@ -58,6 +59,9 @@ class PaymentControllerTest extends WithoutFilterSupporter {
@Autowired
PaymentRepository paymentRepository;

@Autowired
PaymentSearchRepository paymentSearchRepository;

@Autowired
ProductRepository productRepository;

Expand Down Expand Up @@ -170,7 +174,6 @@ void confirm_toss_exception() throws Exception {
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isInternalServerError())
.andDo(print());
System.out.println(payment.getStatus());
assertThat(payment.getPaymentKey()).isEqualTo(PAYMENT_KEY);
assertThat(payment.getStatus()).isEqualTo(PaymentStatus.ABORTED);
}
Expand Down

0 comments on commit 0d63bd3

Please sign in to comment.