SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Apps Code Bible II




2009. 11. 12
Custom APIs




 1. 일촌 추천 UI
    - opensocial.requestShareApp

 2. 게시물로 저장하기
    - openNate.minihpScrap

 3. Payment
     - openNate.dotoriPayment
일촌 초대하기 – opensocial.requestShareApp



  일촌 초대 팝업 UI 또는 직접 호출을 통해 초대 feed 발송

      * Method
      opensocial.requestShareApp

      * Parameter
      recipients : 수신자 IDs, array
      message : opensocial message 객체
      callbackFn : 콜백함수 (optional)



                                                                    Sample code

  opensocial.requestShareApp(recipients , message, opt_callback);
  opensocial.requestShareApp(recipients , null, opt_callback);
  opensocial.requestShareApp(null , message, opt_callback);
  opensocial.requestShareApp(null , null, opt_callback);
일촌 초대하기 – opensocial.requestShareApp

                                                            Sample code

  ⓐ   opensocial.requestShareApp(recipients , message, opt_callback);
  ⓑ   opensocial.requestShareApp(recipients , null, opt_callback);
  ⓒ   opensocial.requestShareApp(null , message, opt_callback);
  ⓓ   opensocial.requestShareApp(null , null, opt_callback);


  1) 앱스토어 초대 기본 메시지 ex) 미니미님이 싸이앱스를 추천하였습니다.
  2) message : 앱스 지정 메시지 ex) 정말 좋아요
  3) 사용자 작성 메시지 ex) 야~ 나랑 앱스하자



  hint)
  recipients 는 일촌초대 팝업 UI 사용 여부와 관련이 있음
openNate 시작하기




        <Require feature="opennate" />


                                               Sample code
   <?xml version="1.0" encoding="UTF-8" ?>
   <Module>
     <ModulePrefs>
        <Require feature="opensocial-0.8" />
        <Require feature="opennate" />
     </ModulePrefs>
     <Content type="html">
     <![CDATA[

     ]]>
     </Content>
   </Module>
게시물로 저장하기 – openNate.minihpScrap



      앱스에서 생성된 컨텐츠를 미니홈피 게시판에 저장

     * Method
     openNate.minihpScrap

     * Parameter
     openNate.ScrapParameters.CONTENT

     * Return
     None

                                             Sample code

  var params = {};
  params[openNate.ScrapParameters.CONTENT] =
                                  "<u>게시물</u>로 저장되는 내용";
  openNate.minihpScrap(params);
Payment – openNate.dotoriPayment



             앱스에서 네이트 도토리 결제시스템 이용

      * Method
      openNate.dotoriPayment

      * Parameter
      openNate.PaymentParameters.ITEMTYPE
      openNate.PaymentParameters.ITEMID
      openNate.PaymentParameters.ITEMNAME
      openNate.PaymentParameters.THUMBNAIL
      openNate.PaymentParameters.DOTORI
      openNate.PaymentParameters.CALLBACKFN
      openNate.PaymentParameters.PASSTHROUGH
      openNate.PaymentParameters.CALLBACKURL

      * Return
      object
Payment – openNate.dotoriPayment




      * Return 객체
      paymentKey
      passthrough
      status
      message


        status            message                             설명

         true             Success          결제 성공

                                           3rd party 서버와의 통신상의 오류
       ERR001        Communication error
                                           1단계 통신중 오류 및 3rd party 프로세스 실행중 오류


       ERR002            Dotori error      네이트 도토리 결제 처리중 오류


                                           네이트 도토리 결제 처리 이후 3rd party 서버 프로세스 실행중
       ERR003           Payment error
                                           오류 또는 2단계 통신중 오류


       ERR004           Expired page       동일한 결제에 대한 재요청 발생
payment            데이터 흐름




      3rd party 앱스            결제 버튼 클릭
                                                              -계약정보 확인           4
                                                                                               6 11 파라미터
                                                                                                   status – ready, accepted, failed
                  openNate.dotoriPayment 실행                                                        payment_key
     19                                                                                            passthrough
          callbackFN                                                                               user_id
                                                              -payment_key 생성    5                 apps_no
                                                              -결제 요청정보 저장                          item_id
                                                                                                   item_type
                                                                                                   item_name
                                      Popup UI                                                     item_dotori
                                                                                                   mac
                                                              -request parameter 및
                                                              shared key를 이용하여 hmac   6
                         1                  3                 키 생성
          도토리 부족
                                    결제 팝업
           알림 팝업
18                                                                                                          3rd party 서버 프로세스
                                                                                                                                       7
                                                                                                            -passthrough 확인
                                2                                                                           -Mac key 생성 후 비교
                       네이트 도토리                                HTTP RC 확인        9          8                -아이템 정보 임시 저장 등
                        충전 팝업                        ERR001
                                                                                                            response HTTP RC

                                                16
                             결제 진행 결과 팝업
                              - 에러 메시지               ERR002   네이트 도토리 차감        10
                                                              도토리 차감 결과 전송                                 11
                                                                                                                                      12
                                                                                                            3rd party 서버 프로세스
                                                                                                            -Passthrough, mac key 등 확인
                        17 결제 진행 결과 팝업
                               - 결제 성공
                                                     ERR003 HTTP RC 확인          15    14                    -사용자 아이템 구매 정보 저장
                                                     (고객센터)
                                                                                                            response HTTP RC          13
Payment – openNate.dotoriPayment



                     dotoriPayment API 활용
                                                     Sample code

     var params = {};
     params[openNate.PaymentParameters.ITEMTYPE] = “item_type”;
     params[openNate.PaymentParameters.ITEMID] = “item_id”;
     params[openNate.PaymentParameters.ITEMNAME] = “item_name”;
     params[openNate.PaymentParameters.THUMBNAIL] =
                                            “image_thumbnail_url”;
     params[openNate.PaymentParameters.DOTORI] = “dotori”;
     params[openNate.PaymentParameters.CALLBACKFN] =
                                            "callbackFunction";
     params[openNate.PaymentParameters.PASSTHROUGH] =
                                            “generated passthrough";
     params[openNate.PaymentParameters.CALLBACKURL] =
                           "http://www.thirdparty.com/callback.php";

     openNate.dotoriPayment(params);
Payment – 팝업 UI



                             2

                     1




                         3




  앱스에서
dotoriPayment                    네이트컨테이너
호출시 팝업 UI                        결제 프로세스
Payment – 3rd party 로의 http request



   callback URL :
  http://www.thirdparty.com/callback

  parameters :
  payment_key=2059ec5f423caac343f6677de784d320&user_id=12345678
  &apps_no=10&item_id=3&item_type=COIN&item_name=test+item&ite
  m_dotori=10&status=ready&passthrough=kjse23fjs52fgsog34

  shared key :
  opennate_payment_shared_key

  generated MAC key :
  bcd9cf234c6cb711eb14d488ebe5d8e0

  http request :
  http://www.thirdparty.com/callback?payment_key=2059ec5f423caac343f
  6677de784d320&user_id=12345678&apps_no=10&item_id=3&item_typ
  e=COIN&item_name=test+item&item_dotori=10&status=ready&passth
  rough=kjse23fjs52fgsog34&mac=bcd9cf234c6cb711eb14d488ebe5d8e0
Payment – hmac key 생성



                        RFC 2104 HMAC_MD5

 C = callbackURL [eg " http://www.thirdparty.com/callback"]
 P = 파라미터 [eg "param1=value1&param2=value2&...&paramN=valueN"]
 K = the shared secret key
 H = md5

 M = hash (K,P) = H ((K XOR opad) + H ((K XOR ipad) + P))

 opad : outer padding (0x5c5c…5c5c, one-block-long hexadecimal constant)
 ipad : inner padding (0x3636…3636, one-block-long hexadecimal constant)

 request (C,P,K) =
 "
 http://www.thirdparty.com/callback?param1=value1&param2=value2&...&pa
 ramN=valueN&mac="+ M
Payment – 3rd party 서버 프로세스



                          이것만은 지키자.

      1. Payment API 실행시 passthrough 값 생성

      2. 전송된 passthrough 값이 서버에서 생성된 값인지 확인

      3. Hmac key 생성 후 request parameter 중 mac 값과 비교

      4. 아이템 구매 내역 로그 기록

      5. Shared key 는 소중하게 관리
감사합니다.

Contenu connexe

En vedette

2011 대한민국 소셜게임 컨퍼런스 강연자료_20110415_3. (수정)한경소셜게임컨퍼런스 선데이토즈 이정웅_최종(서체포함)
2011 대한민국 소셜게임 컨퍼런스 강연자료_20110415_3. (수정)한경소셜게임컨퍼런스 선데이토즈 이정웅_최종(서체포함)2011 대한민국 소셜게임 컨퍼런스 강연자료_20110415_3. (수정)한경소셜게임컨퍼런스 선데이토즈 이정웅_최종(서체포함)
2011 대한민국 소셜게임 컨퍼런스 강연자료_20110415_3. (수정)한경소셜게임컨퍼런스 선데이토즈 이정웅_최종(서체포함)Cyworld AppStore (SK Communications)
 
3 1 a17 2011년 한국 소셜 게임10가지 이슈-한경컨퍼런스
3 1 a17 2011년 한국 소셜 게임10가지 이슈-한경컨퍼런스3 1 a17 2011년 한국 소셜 게임10가지 이슈-한경컨퍼런스
3 1 a17 2011년 한국 소셜 게임10가지 이슈-한경컨퍼런스Cyworld AppStore (SK Communications)
 

En vedette (12)

2010 Korea Social Game Conference .2
2010 Korea Social Game Conference .22010 Korea Social Game Conference .2
2010 Korea Social Game Conference .2
 
Cyworld AppStore Overview
Cyworld AppStore OverviewCyworld AppStore Overview
Cyworld AppStore Overview
 
Make 앱스: 앱스 제작 방식 및 API 안내
Make 앱스: 앱스 제작 방식 및 API 안내Make 앱스: 앱스 제작 방식 및 API 안내
Make 앱스: 앱스 제작 방식 및 API 안내
 
2010 Korea Social Game Conference .5
2010 Korea Social Game Conference .52010 Korea Social Game Conference .5
2010 Korea Social Game Conference .5
 
2011 대한민국 소셜게임 컨퍼런스 강연자료_20110415_3. (수정)한경소셜게임컨퍼런스 선데이토즈 이정웅_최종(서체포함)
2011 대한민국 소셜게임 컨퍼런스 강연자료_20110415_3. (수정)한경소셜게임컨퍼런스 선데이토즈 이정웅_최종(서체포함)2011 대한민국 소셜게임 컨퍼런스 강연자료_20110415_3. (수정)한경소셜게임컨퍼런스 선데이토즈 이정웅_최종(서체포함)
2011 대한민국 소셜게임 컨퍼런스 강연자료_20110415_3. (수정)한경소셜게임컨퍼런스 선데이토즈 이정웅_최종(서체포함)
 
SK Communications Open 비전 및 발전 방향
SK Communications Open 비전 및 발전 방향SK Communications Open 비전 및 발전 방향
SK Communications Open 비전 및 발전 방향
 
NATE AppStore Weekly Report 2010-11-02
NATE AppStore Weekly Report 2010-11-02NATE AppStore Weekly Report 2010-11-02
NATE AppStore Weekly Report 2010-11-02
 
2 2 그라비티 송원영
2 2 그라비티 송원영2 2 그라비티 송원영
2 2 그라비티 송원영
 
NATE AppStore Weekly Report 2010-12-07
NATE AppStore Weekly Report 2010-12-07NATE AppStore Weekly Report 2010-12-07
NATE AppStore Weekly Report 2010-12-07
 
3 1 a17 2011년 한국 소셜 게임10가지 이슈-한경컨퍼런스
3 1 a17 2011년 한국 소셜 게임10가지 이슈-한경컨퍼런스3 1 a17 2011년 한국 소셜 게임10가지 이슈-한경컨퍼런스
3 1 a17 2011년 한국 소셜 게임10가지 이슈-한경컨퍼런스
 
Apps AtoZ_제2회 Hello, Dev.Square 개발자 세미나
Apps AtoZ_제2회 Hello, Dev.Square 개발자 세미나Apps AtoZ_제2회 Hello, Dev.Square 개발자 세미나
Apps AtoZ_제2회 Hello, Dev.Square 개발자 세미나
 
2010 Korea Social Game Conference .4
2010 Korea Social Game Conference .42010 Korea Social Game Conference .4
2010 Korea Social Game Conference .4
 

Plus de Cyworld AppStore (SK Communications)

Plus de Cyworld AppStore (SK Communications) (20)

Cyworld appstore weeklyreport0402
Cyworld appstore weeklyreport0402Cyworld appstore weeklyreport0402
Cyworld appstore weeklyreport0402
 
Cyworld appstore weeklyreport_0327_1
Cyworld appstore weeklyreport_0327_1Cyworld appstore weeklyreport_0327_1
Cyworld appstore weeklyreport_0327_1
 
Cyworld AppStore Weekly Report 2012-03-20
Cyworld AppStore Weekly Report 2012-03-20Cyworld AppStore Weekly Report 2012-03-20
Cyworld AppStore Weekly Report 2012-03-20
 
Cyworld AppStore Weekly Report 2012-03-06
Cyworld AppStore Weekly Report 2012-03-06Cyworld AppStore Weekly Report 2012-03-06
Cyworld AppStore Weekly Report 2012-03-06
 
Cyworld AppStore Weekly Report 2012-02-14
Cyworld AppStore Weekly Report 2012-02-14Cyworld AppStore Weekly Report 2012-02-14
Cyworld AppStore Weekly Report 2012-02-14
 
Cyworld AppStore Weekly Report 2012-02-07
Cyworld AppStore Weekly Report 2012-02-07Cyworld AppStore Weekly Report 2012-02-07
Cyworld AppStore Weekly Report 2012-02-07
 
Cyworld AppStore Weekly Report 2012-01-31
Cyworld AppStore Weekly Report 2012-01-31Cyworld AppStore Weekly Report 2012-01-31
Cyworld AppStore Weekly Report 2012-01-31
 
Cyworld AppStore Weekly Report 2012-01-24
Cyworld AppStore Weekly Report 2012-01-24Cyworld AppStore Weekly Report 2012-01-24
Cyworld AppStore Weekly Report 2012-01-24
 
Cyworld AppStore Weekly Report 2012-01-17
Cyworld AppStore Weekly Report 2012-01-17Cyworld AppStore Weekly Report 2012-01-17
Cyworld AppStore Weekly Report 2012-01-17
 
Cyworld AppStore Weekly Report 2012-01-10
Cyworld AppStore Weekly Report 2012-01-10Cyworld AppStore Weekly Report 2012-01-10
Cyworld AppStore Weekly Report 2012-01-10
 
Cyworld AppStore Weekly Report 2012-01-03
Cyworld AppStore Weekly Report 2012-01-03Cyworld AppStore Weekly Report 2012-01-03
Cyworld AppStore Weekly Report 2012-01-03
 
Cyworld AppStore Weekly Report 2011-12-27
Cyworld AppStore Weekly Report 2011-12-27Cyworld AppStore Weekly Report 2011-12-27
Cyworld AppStore Weekly Report 2011-12-27
 
Cyworld AppStore Weekly Report 2011-12-20
Cyworld AppStore Weekly Report 2011-12-20Cyworld AppStore Weekly Report 2011-12-20
Cyworld AppStore Weekly Report 2011-12-20
 
Cyworld AppStore Weekly Report 2011-12-13
Cyworld AppStore Weekly Report 2011-12-13Cyworld AppStore Weekly Report 2011-12-13
Cyworld AppStore Weekly Report 2011-12-13
 
Cyworld AppStore Weekly Report 2011-11-22
Cyworld AppStore Weekly Report 2011-11-22Cyworld AppStore Weekly Report 2011-11-22
Cyworld AppStore Weekly Report 2011-11-22
 
Cyworld AppStore Weekly Report 2011-11-15
Cyworld AppStore Weekly Report 2011-11-15Cyworld AppStore Weekly Report 2011-11-15
Cyworld AppStore Weekly Report 2011-11-15
 
Korean social game market trend report (2011Q2) Eng
Korean social game market trend report (2011Q2) EngKorean social game market trend report (2011Q2) Eng
Korean social game market trend report (2011Q2) Eng
 
Cyworld AppStore Weekly Report 2011-10-11
Cyworld AppStore Weekly Report 2011-10-11Cyworld AppStore Weekly Report 2011-10-11
Cyworld AppStore Weekly Report 2011-10-11
 
Cyworld AppStore Weekly Report 2011-09-27
Cyworld AppStore Weekly Report 2011-09-27Cyworld AppStore Weekly Report 2011-09-27
Cyworld AppStore Weekly Report 2011-09-27
 
Cyworld AppStore Weekly Report 2011-08-09
Cyworld AppStore Weekly Report 2011-08-09Cyworld AppStore Weekly Report 2011-08-09
Cyworld AppStore Weekly Report 2011-08-09
 

Dernier

MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 

Dernier (6)

MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 

Apps Code Bible II_제 2회 Hello, Dev.Square 개발자 세미나

  • 1. Apps Code Bible II 2009. 11. 12
  • 2. Custom APIs 1. 일촌 추천 UI - opensocial.requestShareApp 2. 게시물로 저장하기 - openNate.minihpScrap 3. Payment - openNate.dotoriPayment
  • 3. 일촌 초대하기 – opensocial.requestShareApp 일촌 초대 팝업 UI 또는 직접 호출을 통해 초대 feed 발송 * Method opensocial.requestShareApp * Parameter recipients : 수신자 IDs, array message : opensocial message 객체 callbackFn : 콜백함수 (optional) Sample code opensocial.requestShareApp(recipients , message, opt_callback); opensocial.requestShareApp(recipients , null, opt_callback); opensocial.requestShareApp(null , message, opt_callback); opensocial.requestShareApp(null , null, opt_callback);
  • 4. 일촌 초대하기 – opensocial.requestShareApp Sample code ⓐ opensocial.requestShareApp(recipients , message, opt_callback); ⓑ opensocial.requestShareApp(recipients , null, opt_callback); ⓒ opensocial.requestShareApp(null , message, opt_callback); ⓓ opensocial.requestShareApp(null , null, opt_callback); 1) 앱스토어 초대 기본 메시지 ex) 미니미님이 싸이앱스를 추천하였습니다. 2) message : 앱스 지정 메시지 ex) 정말 좋아요 3) 사용자 작성 메시지 ex) 야~ 나랑 앱스하자 hint) recipients 는 일촌초대 팝업 UI 사용 여부와 관련이 있음
  • 5. openNate 시작하기 <Require feature="opennate" /> Sample code <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs> <Require feature="opensocial-0.8" /> <Require feature="opennate" /> </ModulePrefs> <Content type="html"> <![CDATA[ ]]> </Content> </Module>
  • 6. 게시물로 저장하기 – openNate.minihpScrap 앱스에서 생성된 컨텐츠를 미니홈피 게시판에 저장 * Method openNate.minihpScrap * Parameter openNate.ScrapParameters.CONTENT * Return None Sample code var params = {}; params[openNate.ScrapParameters.CONTENT] = "<u>게시물</u>로 저장되는 내용"; openNate.minihpScrap(params);
  • 7. Payment – openNate.dotoriPayment 앱스에서 네이트 도토리 결제시스템 이용 * Method openNate.dotoriPayment * Parameter openNate.PaymentParameters.ITEMTYPE openNate.PaymentParameters.ITEMID openNate.PaymentParameters.ITEMNAME openNate.PaymentParameters.THUMBNAIL openNate.PaymentParameters.DOTORI openNate.PaymentParameters.CALLBACKFN openNate.PaymentParameters.PASSTHROUGH openNate.PaymentParameters.CALLBACKURL * Return object
  • 8. Payment – openNate.dotoriPayment * Return 객체 paymentKey passthrough status message status message 설명 true Success 결제 성공 3rd party 서버와의 통신상의 오류 ERR001 Communication error 1단계 통신중 오류 및 3rd party 프로세스 실행중 오류 ERR002 Dotori error 네이트 도토리 결제 처리중 오류 네이트 도토리 결제 처리 이후 3rd party 서버 프로세스 실행중 ERR003 Payment error 오류 또는 2단계 통신중 오류 ERR004 Expired page 동일한 결제에 대한 재요청 발생
  • 9. payment 데이터 흐름 3rd party 앱스 결제 버튼 클릭 -계약정보 확인 4 6 11 파라미터 status – ready, accepted, failed openNate.dotoriPayment 실행 payment_key 19 passthrough callbackFN user_id -payment_key 생성 5 apps_no -결제 요청정보 저장 item_id item_type item_name Popup UI item_dotori mac -request parameter 및 shared key를 이용하여 hmac 6 1 3 키 생성 도토리 부족 결제 팝업 알림 팝업 18 3rd party 서버 프로세스 7 -passthrough 확인 2 -Mac key 생성 후 비교 네이트 도토리 HTTP RC 확인 9 8 -아이템 정보 임시 저장 등 충전 팝업 ERR001 response HTTP RC 16 결제 진행 결과 팝업 - 에러 메시지 ERR002 네이트 도토리 차감 10 도토리 차감 결과 전송 11 12 3rd party 서버 프로세스 -Passthrough, mac key 등 확인 17 결제 진행 결과 팝업 - 결제 성공 ERR003 HTTP RC 확인 15 14 -사용자 아이템 구매 정보 저장 (고객센터) response HTTP RC 13
  • 10. Payment – openNate.dotoriPayment dotoriPayment API 활용 Sample code var params = {}; params[openNate.PaymentParameters.ITEMTYPE] = “item_type”; params[openNate.PaymentParameters.ITEMID] = “item_id”; params[openNate.PaymentParameters.ITEMNAME] = “item_name”; params[openNate.PaymentParameters.THUMBNAIL] = “image_thumbnail_url”; params[openNate.PaymentParameters.DOTORI] = “dotori”; params[openNate.PaymentParameters.CALLBACKFN] = "callbackFunction"; params[openNate.PaymentParameters.PASSTHROUGH] = “generated passthrough"; params[openNate.PaymentParameters.CALLBACKURL] = "http://www.thirdparty.com/callback.php"; openNate.dotoriPayment(params);
  • 11. Payment – 팝업 UI 2 1 3 앱스에서 dotoriPayment 네이트컨테이너 호출시 팝업 UI 결제 프로세스
  • 12. Payment – 3rd party 로의 http request callback URL : http://www.thirdparty.com/callback parameters : payment_key=2059ec5f423caac343f6677de784d320&user_id=12345678 &apps_no=10&item_id=3&item_type=COIN&item_name=test+item&ite m_dotori=10&status=ready&passthrough=kjse23fjs52fgsog34 shared key : opennate_payment_shared_key generated MAC key : bcd9cf234c6cb711eb14d488ebe5d8e0 http request : http://www.thirdparty.com/callback?payment_key=2059ec5f423caac343f 6677de784d320&user_id=12345678&apps_no=10&item_id=3&item_typ e=COIN&item_name=test+item&item_dotori=10&status=ready&passth rough=kjse23fjs52fgsog34&mac=bcd9cf234c6cb711eb14d488ebe5d8e0
  • 13. Payment – hmac key 생성 RFC 2104 HMAC_MD5 C = callbackURL [eg " http://www.thirdparty.com/callback"] P = 파라미터 [eg "param1=value1&param2=value2&...&paramN=valueN"] K = the shared secret key H = md5 M = hash (K,P) = H ((K XOR opad) + H ((K XOR ipad) + P)) opad : outer padding (0x5c5c…5c5c, one-block-long hexadecimal constant) ipad : inner padding (0x3636…3636, one-block-long hexadecimal constant) request (C,P,K) = " http://www.thirdparty.com/callback?param1=value1&param2=value2&...&pa ramN=valueN&mac="+ M
  • 14. Payment – 3rd party 서버 프로세스 이것만은 지키자. 1. Payment API 실행시 passthrough 값 생성 2. 전송된 passthrough 값이 서버에서 생성된 값인지 확인 3. Hmac key 생성 후 request parameter 중 mac 값과 비교 4. 아이템 구매 내역 로그 기록 5. Shared key 는 소중하게 관리