我通过Javascript SDK使用Payments API。用户完成付款后,我想重定向到FB中的感谢页面。我知道redirect_uri仅限于FB App设置中定义的站点。那我该怎么做?或者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 :(得分: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";