Skip to content

Commit

Permalink
Merge pull request #125 from Orange-Co/feature/payment
Browse files Browse the repository at this point in the history
chore: add jackson
  • Loading branch information
Kang1221 authored Oct 15, 2024
2 parents dcf5423 + 0ecc910 commit cdae5ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ dependencies {
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'
implementation 'com.nimbusds:nimbus-jose-jwt:3.1'
//jackson
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.0'
// GCP
implementation group: 'com.google.cloud', name: 'google-cloud-storage', version: '2.40.1'
// Google Firebase Admin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package co.orange.ddanzi.dto.payment;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Builder
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class PortOneTokenRequestDto {
private String imp_key;
private String imp_secret;
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/co/orange/ddanzi/service/PaymentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import co.orange.ddanzi.repository.*;
import co.orange.ddanzi.service.common.FcmService;
import co.orange.ddanzi.service.common.HistoryService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -176,8 +178,11 @@ public String getPortOneAccessToken(){
.build();

HttpEntity<PortOneTokenRequestDto> entity = new HttpEntity<>(requestBody, headers);
log.info("Access Key: {}", accessKey); // 확인 용도
log.info("Access Secret: {}", accessSecret);
try {
log.info("Request Body: {}", new ObjectMapper().writeValueAsString(requestBody));
} catch (JsonProcessingException e) {
log.error("JSON 직렬화 오류: {}", e.getMessage());
}
RestTemplate restTemplate = new RestTemplate();
try {
ResponseEntity<PortOneTokenResponseDto> response = restTemplate.postForEntity(url, entity, PortOneTokenResponseDto.class);
Expand Down

0 comments on commit cdae5ad

Please sign in to comment.