0

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.

apaderno
  • 28,547
  • 16
  • 75
  • 90
Jon Deu
  • 31
  • 1
  • 4

2 Answers2

3

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!

Jon Deu
  • 31
  • 1
  • 4
1

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.
Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720