Forum PayVault Check if user has paid for coins or was given credit()

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

Check if user has paid for coins or was given credit()

Postby Pixelante » July 11th, 2012, 12:31 am

I'm trying to check if a user has paid real money or if they have Coins because they received them through an in-game event (using credit() on the server).

I've sent through a live paypal payment as a test and the coins were deposited correctly, but I've noticed the transaction doesn't show up in the vault history. If there a way to check for these transactions?

(I'm not particularly proficient in C#)
Code: Select all
PayVault.Refresh(delegate()
{
    Console.WriteLine("PayVault refreshed: " + PayVault.Coins.ToString());
    PayVault.ReadHistory(1, 10, delegate(PayVaultHistoryEntry[] history)
    {
        Console.WriteLine("PayVault history page 1: " + history.Count());
        foreach(PayVaultHistoryEntry hist in history)
        {
            Console.WriteLine("PayVault hist amount: " + hist.Amount.ToString());
        }
    });
}

//outputs:
//PayVault refreshed: 2875
//PayVault history page 1: 0
Pixelante
Paid Member
 
Posts: 6
Joined: June 26th, 2011, 10:03 pm

Re: Check if user has paid for coins or was given credit()

Postby Henrik » July 11th, 2012, 9:36 am

ReadHistory is 0-indexed, so if you send in 0, 10 instead, you'll get the latest 10 entries.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Check if user has paid for coins or was given credit()

Postby Pixelante » July 11th, 2012, 4:18 pm

Ah, thanks.

The documentation shows 1, 10 in the ReadHistory() example code, which is what threw me off.
http://playerio.com/documentation/reference/multiplayer/playerio.gamelibrary.payvault
Pixelante
Paid Member
 
Posts: 6
Joined: June 26th, 2011, 10:03 pm

Re: Check if user has paid for coins or was given credit()

Postby Henrik » July 11th, 2012, 6:46 pm

Whoops. The reference docs are correct at least. :-)
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to PayVault