Contenu connexe Plus de Cyworld AppStore (SK Communications) (20) Apps Code Bible II_제2회 Hello, Dev.Square 개발자 세미나 발표자료3. 일촌 초대하기 – opensocial. requestShareApp 일촌 초대 팝업 UI 또는 직접 호출을 통해 초대 feed 발송 opensocial.requestShareApp(recipients , message, opt_callback); opensocial.requestShareApp(recipients , null, opt_callback); opensocial.requestShareApp(null , message, opt_callback); opensocial.requestShareApp(null , null, opt_callback); Sample code * Method opensocial.requestShareApp * Parameter recipients : 수신자 IDs, array message : opensocial message 객체 callbackFn : 콜백함수 (optional) 5. openNate 시작하기 <Require feature="opennate" /> <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs> <Require feature="opensocial-0.8" /> <Require feature="opennate" /> </ModulePrefs> <Content type="html"> <![CDATA[ ]]> </Content> </Module> Sample code 6. 게시물로 저장하기 – openNate.minihpScrap 앱스에서 생성된 컨텐츠를 미니홈피 게시판에 저장 var params = {}; params[openNate.ScrapParameters.CONTENT] = "<u> 게시물 </u> 로 저장되는 내용 "; openNate.minihpScrap(params); Sample code * Method openNate.minihpScrap * Parameter openNate.ScrapParameters.CONTENT * Return None 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 동일한 결제에 대한 재요청 발생 네이트 도토리 결제 처리 이후 3rd party 서버 프로세스 실행중 오류 또는 2 단계 통신중 오류 네이트 도토리 결제 처리중 오류 3 rd party 서버와의 통신상의 오류 1 단계 통신중 오류 및 3 rd party 프로세스 실행중 오류 결제 성공 설명 Dotori error ERR002 status message true Success ERR001 Communication error ERR003 Payment error ERR004 Expired page 10. Payment – openNate. dotoriPayment 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); Sample code dotoriPayment API 활용 12. Payment – 3 rd 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&item_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=2059ec5f423caac343f6677de784d320&user_id=12345678&apps_no=10&item_id=3&item_type=COIN&item_name=test+item&item_dotori=10&status=ready&passthrough=kjse23fjs52fgsog34&mac=bcd9cf234c6cb711eb14d488ebe5d 8e0 13. Payment – hmac key 생성 C = callbackURL [eg " http://www.thirdparty.com/callback"] P = 파라미터 [eg "param1=value1¶m2=value2&...¶mN=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¶m2=value2&...¶mN=valueN&mac="+ M RFC 2104 HMAC_MD5