Forum PayVault Facebook credits for a game not on sitebox

Discussion and help relating to the PlayerIO payment solution, PayVault.

Facebook credits for a game not on sitebox

Postby paala2 » March 19th, 2013, 10:14 am

Hello,
Is there a way to make Facebook credits work for a game not on sitebox and using the normal graph api.
Also the normal graph api means that there is no As3 to javascript sdk to facebook but only as3 to facebook.
Here:http://stackoverflow.com/questions/10058019/integrate-facebook-credits-with-as3-sdk is how it sopposed to be done.
But my callback url for payments is the one provider by player io.
is this possible? or i need to use sitebox and javascript SDK?
paala2
 
Posts: 36
Joined: November 4th, 2012, 10:13 am

Re: Facebook credits for a game not on sitebox

Postby Benjaminsen » March 19th, 2013, 11:17 am

You cannot make payments using Facebook without interacting with their Javascript UI API as it's the only way to spawn the payment dialogues.

Likewise your game must exist in a Facebook canvas context for payments to work. So you cannot for instance use it on your own website. Only on Facebook applications.

If you use Sitebox or any other form of hosting does not really matter :)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Facebook credits for a game not on sitebox

Postby paala2 » March 19th, 2013, 11:43 am

here: http://fbdevforum.com/facebook-developers/forum.developers.facebook.net/viewtopiccdd6bceb4f14bd93275a2988138f10bc.html,
it said that you can invoke the payment dialog via graph api without JS or PHP.
paala2
 
Posts: 36
Joined: November 4th, 2012, 10:13 am

Re: Facebook credits for a game not on sitebox

Postby Benjaminsen » March 19th, 2013, 5:07 pm

Facebook.ui is a wrapper for the JS api. No magic there. Works exactly like our FB API :)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Facebook credits for a game not on sitebox

Postby samsonadze » March 19th, 2013, 5:11 pm

so what i have to do? :(
C#
samsonadze
 
Posts: 122
Joined: August 29th, 2012, 2:39 pm

Re: Facebook credits for a game not on sitebox

Postby paala2 » March 20th, 2013, 9:08 am

The app you are using is not responding. Please try again later.

this is my code:
Code: Select all
clientul.payVault.getBuyCoinsInfo(
                  "facebook",                              //Provider name
                  {                                    //Purchase arguments
                   coinamount:"100",                     //(See table below)
                title:"100 Coins",
                description:"Buy 100 Coins for my awesome game",
                      image_url:"http://www.top100flashgames.com/images/ad_example.png",
                    product_url:"http://www.top100flashgames.com/our-games/"
                 },
                //Success handler
                function(info:Object):void{
      //If you use the Player.IO Facebook AS3 API, you can call the FB.ui
      //method directly from Flash, otherwise you have to pass the info
      //object to the containing page and call the javascript method there.
      //If you host your game on Sitebox this is automatically included.
                 /*  var title:String = "TITLE FOO";
                     var desc:String = "FOO";
                     var price:String = "200";
                     var img_url:String = "http://www.top100flashgames.com/images/ad_example.png";
                       var product_url:String = "http://www.top100flashgames.com/images/";
                var order_info:Object = {
                       "title":title,
                      "description":desc,
                      "price":price,
                        "image_url":img_url,
                      "product_url":product_url
                 coinamount:"100",                     //(See table below)
                title:"100 Coins",
                description:"Buy 100 Coins for my awesome game",
                      image_url:"http://www.top100flashgames.com/images/ad_example.png",
                    product_url:"http://www.top100flashgames.com/our-games/"
                   };*/
      
      
           var obj:Object = {
              method: 'pay.prompt',
            /* order_info: order_info,*/
               purchase_type: 'item',
                 credits_purchase: false
            
            /* coinamount:"100",                     //(See table below)
                title:"100 Coins",
                description:"Buy 100 Coins for my awesome game",
                      image_url:"http://www.top100flashgames.com/images/ad_example.png",
                    product_url:"http://www.top100flashgames.com/our-games/"*/
            
            
                 };
              Facebook.ui('pay',obj, function(data:Object):void {
         if (data.order_id) {
            FlxG.log("Purchase completed!");
         } else {
            FlxG.log("Purchase failed.");
         }
            });
                },
               //Error handler
                       function(e:PlayerIOError):void{ trace("Unable to buy coins", e) }   
                          )


if the message above appears it seams that the payment is invoked but the playerio response was missing. So what arguments shall I pass to the pay function to work?

Thanks.
paala2
 
Posts: 36
Joined: November 4th, 2012, 10:13 am

Re: Facebook credits for a game not on sitebox

Postby Benjaminsen » March 21st, 2013, 7:10 pm

I am afraid you will have to sort it all out yourself. While we are happy to help with Player.IO systems, what are you trying to do is not Player.IO related.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to PayVault