2013-06-10 1 views
0

페이스 북에서 우리가 다시 한 번 방법을 바꿔야하기 때문에, 우리는 우리의 앱에 지불 옵션으로 "현지 통화"를 소개해야합니다.페이스 북의 현지 통화 지불 예제

그러나 설명서를 이해하기가 어려워 일부 예제 코드가 절실히 필요합니다. 누구든지 몇 가지 샘플 코드를 알고 있다면 크게 감사하겠습니다.

+0

FB 여기 https://developers.facebook.com/docs/howtos/payments/ –

+0

감사합니다이 새로운 기능에 대한 문서가 있습니다. 그러나 나는이 문서를 알고 있지만, 나는 여전히 새로운 "현지 통화"에 따라 성공적인 지불 약속을 만들 수 없다. 내가 원했던 것은 그것이 어떻게 작동하는지 정확히 설명 할 수있는 실제 예제였습니다. – JPJens

답변

0

이 오류는 앱의 개발자/소유자 인 경우,

나는 단지 자신이 밖으로 일한 아직 콜백을 완료하지 않은 다른 계정을 시도 그때 내 대답을 편집합니다 발생 생각 . 희망이 누군가에게 유용합니다. 먼저 HTML 파일로 그래프 객체

<head prefix= 
"og: http://ogp.me/ns# 
fb: http://ogp.me/ns/fb# 
product: http://ogp.me/ns/product#"> 
<meta property="og:type"     content="og:product" /> 
<meta property="og:title"     content="Friend Smash Coin" /> 
<meta property="og:plural_title"   content="Friend Smash Coins" /> 
<meta property="og:image"     content="http://www.friendsmash.com/images/coin_600.png" /> 
<meta property="og:description"   content="Friend Smash Coins to purchase upgrades and items!" /> 
<meta property="og:url"     content="https://www.yourdomain.com/test.html" /> 
<meta property="product:price:amount"  content="0.30"/> 
<meta property="product:price:currency" content="USD"/> 
<meta property="product:price:amount"  content="0.20"/> 
<meta property="product:price:currency" content="GBP"/> 
</head> 

저장이를 만들고 서버에 업로드 yourdomain.com/test.html

방문이 페이지 https://developers.facebook.com/tools/debug 말하고 yournew 여기에 URL (사용자 도메인을 입력 할 수 있습니다. COM/test.html를)

변화 도메인 (yourdomain.com/test.html)

<h2>Purchase a product:</h2> 
<button id="pay">Buy Product</button> 
<div class="returndata" id="output"></div> 


<div id="fb-root"></div> 
<script type="text/javascript"> 
    window.fbAsyncInit = function() { 
    FB.init({ 
     appId  : 'APPID', 
     status  : true, 
     cookie  : true, 
     xfbml  : true 
    }); 

    function buy() { 
     var obj = { 
     method: 'pay', 
     action: 'purchaseitem', 
     product: 'http://yourdomain.com/test.html' 
     }; 

     FB.ui(obj, function(data) { 
      console.log(data); 
     }); 
    } 

    document.getElementById('pay').onclick = function() {buy()}; 
    }; 

    // Load the SDK Asynchronously 
    (function(d){ 
    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; 
    if (d.getElementById(id)) { return; } 
    js = d.createElement('script'); js.id = id; js.async = true; 
    js.src = "//connect.facebook.net/en_US/all.js"; 
    ref.parentNode.insertBefore(js, ref); 
    }(document)); 
</script> 
+0

해답을 가져 주셔서 감사합니다. URL 구문 분석 오류 : \t 입력 URL을 분석하는 중 오류가 발생했습니다. 데이터가 스크랩되지 않았습니다. 디버거로 URL을 구문 분석 할 때 – JPJens

+0

이 무엇입니까? 경로가 정확하고 데이터가 올바르게 포맷 되었습니까? URL은 무엇입니까? –

관련 문제