Forum PayVault How can i make option to sell stuff for fbcredits?

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

How can i make option to sell stuff for fbcredits?

Postby samsonadze » March 18th, 2013, 12:21 pm

What i have to script?
C#
samsonadze
 
Posts: 122
Joined: August 29th, 2012, 2:39 pm


Re: How can i make option to sell stuff for fbcredits?

Postby samsonadze » March 18th, 2013, 10:38 pm

ok i made that,but no popups are coming up... :\ but i see that theres item added in users account. (i used fb as3 graph with Facebook.ui... coz the playerio fb api gave me errors )
C#
samsonadze
 
Posts: 122
Joined: August 29th, 2012, 2:39 pm

Re: How can i make option to sell stuff for fbcredits?

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

samsonadze wrote:ok i made that,but no popups are coming up... :\ but i see that theres item added in users account. (i used fb as3 graph with Facebook.ui... coz the playerio fb api gave me errors )


You are doing something wrong then :)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: How can i make option to sell stuff for fbcredits?

Postby samsonadze » March 19th, 2013, 3:10 pm

Is there any tutorial how to import that fb stuff in to Flash?
C#
samsonadze
 
Posts: 122
Joined: August 29th, 2012, 2:39 pm

Re: How can i make option to sell stuff for fbcredits?

Postby Henrik » March 19th, 2013, 4:33 pm

samsonadze wrote:ok i made that,but no popups are coming up... :\ but i see that theres item added in users account.

If you check the reporting on Facebook, what does that looks like? Did you earn credits?

Facebook has a feature where small Credit purchases complete automatically, without popping up any confirmation window or similar, you could have ran into that.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: How can i make option to sell stuff for fbcredits?

Postby samsonadze » March 19th, 2013, 4:48 pm

hmmm, i made swf just simple,and in that code was this :

Code: Select all
PlayerIO.quickConnect.facebookOAuthConnect(stage,
                                 gameID,
                                 token,
                                 "",
                                 join,
                                 function(r:PlayerIOError):void{
                                    trace(r);
});

function join(client:Client,facebookUserId:String):void
{
client.payVault.refresh(function(){
                  
client.payVault.getBuyDirectInfo(
   "facebook",                              //Provider name
   {                                    //Purchase arguments
      title:"Shop Card",                  //(See table below)
      description:"Get Shop card Noob!",
      image_url:"https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-snc6/166702_466023973470275_2017593925_n.png",
      product_url:"https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-snc6/166702_466023973470275_2017593925_n.png"
   },
   [{itemKey:"shopcard"}],                  //Item to buy
   //Success handler
   function(info:Object):void{
      Facebook.ui("pay",info, function(data:Object):void {
         if (data.order_id) {
            trace("Purchase completed!");
         } else {
            trace("Purchase failed.");
         }
      });
   },
   //Error handler
   function(e:PlayerIOError):void{ trace("Unable to buy item", e) }   
)

                  });
}
and it got me no errors,and No trace :\ it must trace "Purchase Completed" but it dont,and i see the item is added to persons payvault
C#
samsonadze
 
Posts: 122
Joined: August 29th, 2012, 2:39 pm


Return to PayVault