Forum PayVault vault.Refresh() issue

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

vault.Refresh() issue

Postby MentalFish » November 9th, 2011, 1:08 am

I am using Unity, and right now I can't get this to compile:
Code: Select all
PayVault vault = client.PayVault;
vault.Refresh();

Gives me this error message:
No overload for method `Refresh' takes `0' arguments

Whats the case here?
User avatar
MentalFish
 
Posts: 16
Joined: October 31st, 2011, 6:52 am

Re: vault.Refresh() issue

Postby MentalFish » November 9th, 2011, 1:36 am

This would be the answer:
Code: Select all
PayVault vault = client.PayVault;
vault.Refresh(delegate() { coins = client.PayVault.Coins; });

I guess this is needed due to client/server "async-ness" or something? The Unity C# sample code in this case is actually server side C# code?
User avatar
MentalFish
 
Posts: 16
Joined: October 31st, 2011, 6:52 am

Re: vault.Refresh() issue

Postby Oliver » November 9th, 2011, 10:52 am

valut.Refresh(callback) simply starts the asynchronous operation of refreshing the valut. The callback is there so you can be notified when the refresh is complete. It's all clientside code.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: vault.Refresh() issue

Postby MentalFish » November 9th, 2011, 11:30 am

Ok, but the error message I got initially, is from using the example as shown in the documentation:
http://playerio.com/documentation/refer ... t.payvault

Results in this:
No overload for method `Refresh' takes `0' arguments

Since the Refresh() method does not have any arguments insterted, but the compiler complains about it having so, is confusing. Is this a mono limitation/bug or something?
User avatar
MentalFish
 
Posts: 16
Joined: October 31st, 2011, 6:52 am

Re: vault.Refresh() issue

Postby Henrik » November 9th, 2011, 7:04 pm

It's the example code that's wrong. It should show an asynchronous example, not a synchronous one from the regular .Net client.

The error message you got was correct, it said that there was no version of the method called Refresh that takes zero arguments, which is true since you have to supply a success callback and an optional error callback in the Unity client.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: vault.Refresh() issue

Postby MentalFish » November 9th, 2011, 7:19 pm

Ok, thanks for the explanation.

Btw, awesome product you guys have got here, so I did a little fortune telling a few days ago :) http://twitter.com/#!/MentalFish/status ... 0914691072
User avatar
MentalFish
 
Posts: 16
Joined: October 31st, 2011, 6:52 am

Re: vault.Refresh() issue

Postby MentalFish » November 11th, 2011, 10:27 am

Just want to report that I got both PayPal and Facebook payment working. Oh joy! Loving Player.IO at the moment :D

Next up, Kongregate.
User avatar
MentalFish
 
Posts: 16
Joined: October 31st, 2011, 6:52 am


Return to PayVault



cron