0

我通过 Javascript SDK 使用支付 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);
     });
   }
4

1 回答 1

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";
于 2013-10-24T21:09:13.703 回答