윤종우
윤종우
payment 객체 한글 처리 방법
{"mId":"tvivarepublica","lastTransactionKey":"ACC0F0BB616BA31B101E9D3027412B38","paymentKey":"tviva20241206170112rtHy6","orderId":"KOCEA22024120038483128","orderName":"증명 발급 결제","taxExemptionAmount":0,"status":"DONE","requestedAt":"2024-12-06T17:01:12+09:00","approvedAt":"2024-12-06T17:01:41+09:00","useEscrow":false,"cultureExpense":false,"card":{"issuerCode":"11","acquirerCode":"11","number":"42658606**427*","installmentPlanMonths":0,"isInterestFree":false,"interestPayer":null,"approveNo":"00000000","useCardPoint":false,"cardType":"신용","ownerType":"법인","acquireStatus":"READY","amount":1500},"virtualAccount":null,"transfer":null,"mobilePhone":null,"giftCertificate":null,"cashReceipt":null,"cashReceipts":null,"discount":null,"cancels":null,"secret":"ps_ALnQvDd2VJmZzdap6aQY3Mj7X41m","type":"NORMAL","easyPay":{"provider":"삼성페이","amount":0,"discountAmount":0},"country":"KR","failure":null,"isPartialCancelable":true,"receipt":{"url":"https://dashboard.tosspayments.com/receipt/redirection?transactionId=tviva20241206170112rtHy6&ref=PX"},"checkout":{"url":"https://api.tosspayments.com/v1/payments/tviva20241206170112rtHy6/checkout"},"currency":"KRW","totalAmount":1500,"balanceAmount":1500,"suppliedAmount":1364,"vat":136,"taxFreeAmount":0,"method":"간편결제","version":"2022-11-16","metadata":null}
22 replies
payment 객체 한글 처리 방법
이렇게 보내고 있는데 UTF-8로 디코딩해도 결과값이 깨지네요.
22 replies
payment 객체 한글 처리 방법
CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost post = new HttpPost("https://api.tosspayments.com/v1/payments/confirm");
JSONObject json = new JSONObject(); json.put("paymentKey", paymentKey); json.put("orderId", orderId); json.put("amount", amount);
StringEntity entity = new StringEntity(json.toString()); post.setEntity(entity); post.setHeader("Content-Type", "application/json; charset=UTF-8"); String authHeader = "Basic " + java.util.Base64.getEncoder().encodeToString((SECRET_KEY + ":").getBytes()); post.setHeader("Authorization", authHeader);
HttpResponse apiResponse = httpClient.execute(post); String responseBody = new String(EntityUtils.toString(apiResponse.getEntity()).getBytes(), "UTF-8");
22 replies
payment 객체 한글 처리 방법
네. 감사합니다.
22 replies
payment 객체 한글 처리 방법
method는 영문이라서
22 replies
payment 객체 한글 처리 방법
승인요청 API 호출할 때도 UTF-8 인코딩 해서 보내야 한다는 건가요? 영문인데 인코딩이 필요한가요?
22 replies
payment 객체 한글 처리 방법
디코딩을 UTF-8로 하라는거죠?
22 replies
payment 객체 한글 처리 방법
결제 화면 띄울 때는 SDK를 사용해서 띄우는데 method를 'CARD'로 넣습니다. 이 값을 깨지지 않았구요. 그런데 받을 때는 한글로 나오는 것 같습니다.
22 replies