Credits callback script not called (error 1383046)

北城余情 提交于 2019-12-12 04:01:38

问题


I have a problem getting facebook to call my credits callback script. I've setup a company and the callback url. I used the example script for it. But nonetheless I always get this error when I try to access the payment window using the JS sdk.

var obj = {
    method: 'pay',
    order_info: order_info,
    purchase_type: 'item'
    // dev_purchase_params: {'oscif': true}
 };

 FB.ui(obj, getCashCB);

Error:

There Was a Problem Processing Your Payment Sorry, but we're having trouble processing your payment. You have not been charged for this transaction. Please try again.

error code from console: 1383046 meaning:

1383046 AppInvalidDecodedResponse The application return value was invalid after json_decoding the return value.

No matter if I'm in sandbox mode, set the callback url to something completely different. The callback script is never called.

I've searched far and long for anybody else with this problem, but found nothing meaningful. There was something about the server accepting curl requests from facebook but I don't know what that means or how to test for it.


回答1:


Solved! Whilst looking for the cause I noticed that this error can pop up from a lot of things. But this case is rather specific:

Because the facebook app is still in development, we hid it behind a .htaccess file. So when you visit the site, you login, and the app loads etc. BUT this doesn't work for the credits callback file. Since the request then comes from facebook, it would have to login with user:pass. I tried putting that in the callback URL, but that doesn't seem to work.

So I only need to put the callback file somewhere where you can reach it without .htaccess and Tadaaa it works!




回答2:


Basically this happens when Facebook doesn't understand the response it gets from calling your payment callback URL. Thew most likely reasons are:

  • The callback URL is wrong
  • Facebook gets an error response because the server or some app-level firewall won't let it access the URL (Jon's problem)
  • Facebook gets an error response because the callback script runs into an exception.
  • The callback script's response is malformed.


来源:https://stackoverflow.com/questions/8166977/credits-callback-script-not-called-error-1383046

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!