GLBasic forum

Main forum => Off Topic => Topic started by: Kitty Hello on 2011-May-05

Title: Paypal - in game purchase
Post by: Kitty Hello on 2011-May-05
Hi,

I think I found out, that you can verify a valid checkout with a php website and you can create "buy now" buttons with html code. So, that would mean I can make a "Buy for a buck" button in a game (SEUCK in detail) and the money is transfered to the creator of that "game" and my php code gets notified of it.

Now - how can the GLBasic program check for that information? Should I create an unique "ID" for the "product on that device" and store that information in a database? What if the device changes? What if the checkout is not valid in the first run?


Title: Re: Paypal - in game purchase
Post by: spicypixel on 2011-May-05
Why not have a simple username and password taken which is POSTed when the BuyItNow button is clicked that way a purchase can be made and if the user ever changes to a different device their confirmed username:password can be checked and simply confirms the purchase for registration. Or am I missing the point of your post Kitty?
Title: Re: Paypal - in game purchase
Post by: Kitty Hello on 2011-May-05
So my database has a list of "valid buys" for a given username/pw string? Might work.
Might need a password recovery system, though.

So, if I need the user email to send a lost password, why not just store the purchase product and the buyer's email address - so in your program you only would have to give the paypal email address you used to buy.

Would anyone resist to give _that_ email into an App?
Title: Re: Paypal - in game purchase
Post by: spicypixel on 2011-May-05
I don't think anyone who had legitimately purchased it would mind at all, especially as its basically a security check as they now have the app on a new device.
Title: Re: Paypal - in game purchase
Post by: Slydog on 2011-May-05
By 'device' do you mean all / any GLBasic supported device, including PC?
(except iOS devices I assume as Apple may not allow this)

You want to allow customers to be able to unlock content for a dollar?  Or the entire game?
Or take SEUCK for example.  Give the game kit away for free and allow people to create games using it, then add it to the SEUCK store?  The designer would get that $1?

Either way I think it may be best to create an authentication routine in PHP, called from GLBasic.
Pass it the customer_id and the game_id, and have a PHP routine lookup that customer_id to see if he purchased that game_id.
You would need to previously log in and authenticate the customer, using a customer database table.

Use a generated customer_id in both the purchases table and the customer table (as opposed the the login name) in case he changes the login name.

Code (glbasic) Select
TABLE customers
- customer_id [integer]
- login [string]
- password [string]
- email [string]

TABLE purchases
- customer_id [integer]
- game_id [integer]


The two tables are joined by 'customer_id'.

Then no matter what device the customer is using he can play his purchased game.  The downside is that he could give his login / password away so anybody could login and play for free.  You could automatically store the device_id when purchasing the game, and only allow up to a certain amount of unique devices, say 10.  After he tries to play it on the 11th device, give him an error message.  But this still means he can give it to 9 of his friends.

Or, you could use the device_id instead of logging in, except that the purchase would only be playable on that certain device, which may be what you want.  He would then need to repurchase it on each device.

How does Apple do it?  If I purchase a game for my iPhone, can I also install it on my iPod or iPad, or 2nd iPhone?  I never tried.
Title: Re: Paypal - in game purchase
Post by: ampos on 2011-May-06
Apple let you share your boughts in five devices.
Title: Re: Paypal - in game purchase
Post by: Kitty Hello on 2011-May-06
OK, I'll try to do it that way then.
Might take some experimenting.