2013-01-17 109 views
0

我通过Javascript SDK使用Payments API。用户完成付款后,我想重定向到FB中的谢谢页面。我明白,redirect_uri仅限于在FB应用程序设置中定义的站点。那么,我该如何做到这一点?还是FB认为他们的弹出式对话框是最后的感谢页面,这就是允许的?我可以重定向到谢谢你的页面吗?

function buy() { 
    var credits= 2; 
    FB.ui({ 
     method: 'pay', 
     credits_purchase: false, 
     order_info: credits, 
     // FB says it will only redirect to the URL registered for the app. 
     // I'll try to fudge by adding a parameter: 
     redirect_uri:'https://apps.facebook.com/MYAPP/index.php?thankyou=1', 
     dev_purchase_params: { 
      oscif: true 
      } 
     }, 
     function(response) { 
     div = document.getElementById('fb-response'); 
     div.innerHTML = JSON.stringify(response); 
    }); 
    } 

回答

0

您可以手动进行重定向,例如,

function(response) 
{ 
    window.location = "https://apps.facebook.com/MYAPP/index.php?thankyou=1"; 
}) 

或发送请求

function(response) 
{ 
    div = document.getElementById('fb-response'); 
    div.innerHTML = JSON.stringify(response); 
}); 
window.location = "https://apps.facebook.com/MYAPP/index.php?thankyou=1"; 
相关问题