GRiMe2D / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

Credit Callback Url not getting called #330

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Call Facebook.ui("pay", {credits_purchase:false, 
order_info:kOrderInfo.order_info}, OnUi, "iframe");
2.
3.

What is the expected output? What do you see instead?
That my credits callback would be called.  Instead, I am getting error 1383008 
in return which indicates that my callback doesn't exist.

What version of the product are you using? On what operating system?
v1.6.1 on vista x64

Please provide any additional information below.
I understand that this may be an internal facebook issue, but I have been 
unable to get any support out of them.  See 
http://bugs.developers.facebook.net/show_bug.cgi?id=18809

My Credits Callback Url is simply not getting called.  In my client flash code,

I'm calling...

Facebook.ui("pay", {credits_purchase:false, order_info:kOrderInfo.order_info}, 
OnUi, "iframe");

Additionally, I have tried testing with: 

Facebook.ui("pay", {purchase_type:"item", order_info:kOrderInfo.order_info}, 
OnUi, "iframe");

Additionally I have tried testing without the "iframe" parameter.

All of these calls boil down to FB.ui(obj, cb) via
ExternalInterface.call('FBAS.ui', JSON.encode(data))

...and I am getting error 1383008 in return.  However, my callback is simply 
not getting called.  I've verified this by copy/pasting my callback directly 
into my browser's address bar and can see my logs that the url was called.  I 
do not get the logs when facebook is supposed to be calling my callback url.

Additionally, this was all working and without modifications this problem 
started occurring.  Also, I can make (requests 2.0 using this library) and 
receive (canvas oauth 2.0) other calls with facebook without problems.

Is this a problem with my browsers?  I have tried testing with both firefox 5.0 
and ie 9... both of which are fairly recent updates.

I've also tested and have this problem with other (dyndns-based) test apps.  
What's going on here?

Please advise.

Thanks,
Jason

Original issue reported on code.google.com by jk...@oneloop.com on 20 Jul 2011 at 10:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Never mind... this problem appears to be occurring when using the server-side 
dialog/pay api as well.

Original comment by jk...@oneloop.com on 24 Jul 2011 at 9:09

GoogleCodeExporter commented 9 years ago

Original comment by rovertn...@gmail.com on 29 Jul 2011 at 9:52

GoogleCodeExporter commented 9 years ago
hi guys, ive been trying but no success... i got this message =(

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.

Original comment by ricardoc...@gmail.com on 19 Sep 2011 at 1:30

GoogleCodeExporter commented 9 years ago
Hi Ricardo,

Are you referring to your own app or mine?  The reason I ask is that our app is 
in sandbox mode so you shouldn't be able to access it.  Additionally, this 
weekend I was able to get the problem resolved.  About two weeks ago, I started 
seeing a different error message.  The reason was that my callback was now 
being called, but there had been an error in the processing of the callback.  
Once that was fixed I had credits working again.  I don't know why facebook 
suddenly started working and making appropriate callbacks.

Cheers,
Jason

Original comment by jk...@oneloop.com on 19 Sep 2011 at 3:35

GoogleCodeExporter commented 9 years ago
theres no sample, even from facebook who works... i feel the callback.php are 
not being called...

Original comment by ricardoc...@gmail.com on 26 Sep 2011 at 7:35

GoogleCodeExporter commented 9 years ago
my callback is called but in the second call (status=placed) my callback return 
the json with the status=settled and FB throw the error: "Sorry, but we're 
having trouble processing your payment. You have not been charged for this 
transaction. Please try again."

Original comment by pabl...@gmail.com on 22 Oct 2011 at 3:32

GoogleCodeExporter commented 9 years ago
I had been having similar problems, using just the test app from github, but 
after making some app setting changes, I was finally able to get that to work. 
More info 

here:
http://stackoverflow.com/questions/7968176/need-help-implementing-facebook-credi
ts

As far as doing all of this through the actionScript sdk, I guess you can't 
have the callback be inside code, since there needs to be a response. Is this 
correct?

For example, if the above call were made from inside actionScript:

Facebook.ui("pay", {purchase_type:"item", order_info:kOrderInfo.order_info}, 
OnUi, "iframe");

The callback php file that is registered in the FB app settings would be called 
and that needs to echo back the response. What exactly would "OnUi" do? Or is 
that also 

called with the same data? And if so, it couldn't respond, could it, or maybe 
you could do an ExternalInterface.call() to a javascript function, which would 
then do a 

php echo of the results?

Sorry, I'm not real confortable in the JavaScript world. It would be really 
great if all of this could be dealt with from within ActionScript.

Any advice would be greatly appreciated.

-brad

Original comment by brad.gia...@gmail.com on 2 Nov 2011 at 8:44

GoogleCodeExporter commented 9 years ago
Correct, you cannot have the callback be inside any client-side code.  For 
example, if you have a test server running locally, it will fail to get the 
facebook registered callback as well because facebook can only make calls to 
registered domain names.

Original comment by jk...@oneloop.com on 2 Nov 2011 at 8:53

GoogleCodeExporter commented 9 years ago
I see.

I was able to get this to work as described above. My test actionscript code 
looks like this:

private function purchaseTest():void
{
   var order_info:Object;

   order_info =
   {
      title:'Test Product',
      description:'Test product description',
      price:'123',
      image_url:'http://www.facebook.com/images/gifts/21.png',
      product_url:'http://www.facebook.com/images/gifts/21.png'
   };

   Facebook.ui(
      "pay.prompt",
      {order_info: order_info, purchase_type: "item"},
      payCallback);
}

private function payCallback(paymentData:Object):void
{
    for (var x in paymentData)
    {
        trace("name: " + x);
    trace("value: " + paymentData[x]);
    }               
}

Notice the "pay.prompt". I saw this in another post:
    http://code.google.com/p/facebook-actionscript-api/issues/detail?id=268

When this function is called, the registered callback is called by FB. The end 
user is prompted to make the purchases, etc. After the transaction is totally 
complete, then the actionscript callback, "payCallback", is called.

If the user successfully makes the purchase, I get this:
    name: status
    value: settled
    name: order_id
    value: 159977120765142

If the user cancels the purchase, I get this:
    name: error_code
    value: 1383010
    name: error_message
    value: User canceled the order.

Thanks for your help.

Original comment by simon.gr...@gmail.com on 3 Nov 2011 at 3:15