단건결제 프로세스 결제준비api 문의합니다

웹에서 카카오페이 연동을 위해 가이드를 보며 테스트를 진행하려고 합니다.
가이드를 보며 해보는데 첫부분부터 막히네요.

  1. 결제준비 API 호출시 AccessToken 과 Admin Key 문의
    AccessToken 은 로그인시 생성되는거 같은데 저희는 카카오로그인을 사용 안하기에 해당이 없을거 같고
    Admin Key 를 어떻게 생성하는건가요???

  2. 단건 결제를 테스트 curl 호출문의
    윈도우환경에서 curl 테스트 코드로 테스트 진행중 권한오류가 납니다.
    기존 테스트 코드도 실행해 보고 ’ → " 로 바꿔서 실행해 봐도 오류가 납니다.
    코드는 기존 테스트 코드 복사해서 그대로 요청을 날렸고 응답은 아래와 같습니다.

C:\Users\Administrator\Downloads\curl_7_53_1_openssl_nghttp2_x64>curl -v -X POST
https://kapi.kakao.com/v1/payment/ready” -H “Authorization: KakaoAK xxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx” --data-urlencode “cid=TC0ONETIME” --data-urlencode “part
ner_order_id=partner_order_id” --data-urlencode "partner_user_id=partner_user_id
" --data-urlencode “item_name=초코파이” --data-urlencode “quantity=1” --data-url
encode “total_amount=2200” --data-urlencode “vat_amount=200” --data-urlencode “t
ax_free_amount=0” --data-urlencode “approval_url=https://developers.kakao.com/su
ccess” --data-urlencode “fail_url=https://developers.kakao.com/fail” --data-urle
ncode “cancel_url=https://developers.kakao.com/cancel”
Note: Unnecessary use of -X or --request, POST is already inferred.

  • Trying 27.0.237.16…
  • TCP_NODELAY set
  • Connected to kapi.kakao.com (27.0.237.16) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
  • successfully set certificate verify locations:
  • CAfile: C:\Users\Administrator\Downloads\curl_7_53_1_openssl_nghttp2_x64\ca-
    bundle.crt
    CApath: none
  • TLSv1.2 (OUT), TLS header, Certificate Status (22):
  • TLSv1.2 (OUT), TLS handshake, Client hello (1):
  • TLSv1.2 (IN), TLS handshake, Server hello (2):
  • TLSv1.2 (IN), TLS handshake, Certificate (11):
  • TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  • TLSv1.2 (IN), TLS handshake, Server finished (14):
  • TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  • TLSv1.2 (OUT), TLS change cipher, Client hello (1):
  • TLSv1.2 (OUT), TLS handshake, Finished (20):
  • TLSv1.2 (IN), TLS change cipher, Client hello (1):
  • TLSv1.2 (IN), TLS handshake, Finished (20):
  • SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
  • ALPN, server did not agree to a protocol
  • Server certificate:
  • subject: C=KR; ST=Jeju-do; L=Jeju-si; O=Kakao Corp.; CN=*.kakao.com
  • start date: Nov 11 00:00:00 2015 GMT
  • expire date: Nov 10 23:59:59 2017 GMT
  • subjectAltName: host “kapi.kakao.com” matched cert’s “*.kakao.com”
  • issuer: C=US; O=thawte, Inc.; CN=thawte SSL CA - G2
  • SSL certificate verify ok.

POST /v1/payment/ready HTTP/1.1
Host: kapi.kakao.com
User-Agent: curl/7.53.1
Accept: /
Authorization: KakaoAK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Length: 341
Content-Type: application/x-www-form-urlencoded

  • upload completely sent off: 341 out of 341 bytes
    < HTTP/1.1 401 Unauthorized
    < Date: Thu, 02 Nov 2017 00:42:05 GMT
    < Server: Apache
    < WWW-Authenticate: KakaoAK
    < Content-Type: application/json;charset=UTF-8
    < Content-Length: 75
    <
    {“msg”:“wrong appKey(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) format”,“code”:-401}* Con
    nection #0 to host kapi.kakao.com left intact
  1. 기존에 카카오페이 결제 연동이 되어있는 시스템이 ASP로 구성되어 있습니다.
    그걸 JSP로 바꾸는 작업을 하는데 이메일 문의했더니 https://developers.kakao.com/docs/restapi/kakaopay-api#결제프로세스
    해당 경로 참조하라고 답변을 받았습니다.
    기존 코드보니 LGCNS.CNSPayService.CnsPayCipher 객체를 사용하는데 CNSPay를 쓰는거 같습니다. 이걸 바로 카카오페이 REST API 로 바꿔도 되는건가요??

@fighting3333

https://developers.kakao.com/docs/restapi/getting-started#앱-생성
위 url 참고하셔서 앱 생성 후 만들어진 admin key 를 사용하시면 헤결됩니다.

lg cns 모듈과는 전혀 상관이 없는 부분은 참고해주세요.