Forum PayVault Basic Setup Problems

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

Basic Setup Problems

Postby coordinatez » October 29th, 2012, 10:26 pm

I've imported the playerio folder and successfully connected to the server via the connect()

This is all AS3 code.
Code: Select all
import playerio.*

PlayerIO.connect(params)
//I'm getting a successful trace function on the callback confirming the connection

//then when I try to call this :D
client.payVault.refresh()


I'm getting an "access of undefined property 'client' " error........

HELP
coordinatez
Paid Member
 
Posts: 1
Joined: October 29th, 2012, 10:06 pm

Re: Basic Setup Problems

Postby Benjaminsen » October 30th, 2012, 10:46 am

Connects take a callback method to which the client is passed.

Example.
Code: Select all
PlayerIO.connect(stage, "[your-game-id]", "public", "userid", "", "", function(client:Client):void{
   client.payVault.refresh(function():void{
      trace(client.payVault.coins);
      client.payVault.buy([{itemKey:"MyItemKey"}], true, function():void{
         trace("Huge success!")
      }, function(e:PlayerIOError):void{
         trace(e);
      })
   })
})


E.g, you need to grap and store the client object returned from .connect to use it later.
Notice that PlayerIO.connect can be replaced with the methods found in QuickConnect
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to PayVault



cron