Would you like my code? It's in C#, it basically authenticates with GOG, then attempts to redeem a code, parses the response, but doesn't redeem it. It allows the user to optionally use their own credentials to redeem the code, thus locking it for 10 minutes and therefore preventing a quick double trade.
It isn't working right now (I suspect GOG have changed the XML they respond to requests with), and I don't really have time to maintain it right now, but it's fairly sound code. Unfortunately the last 2 times I've got it working and opened it up to GOG users, nobody has used it, preferring to risk being scammed.
I can't promise to use it, but it can't hurt to look it over. Keep in mind if I make a hobby site/page it's going to be with a LAMP
configuration (Linux, Apache, MySQL and PHP
), so I'm not sure how much the C# can help. However depending on how the request is done, and what credentials are needed to gather the needed information (who owns the gift-code, which games are unredeemed, if it's valid, etc
) then I might still make use of it.
As for locking it for 10 minutes I don't know how well that would work... (If it works, then great!
) I fully intend to put in place if you trade a code (or trying to trade a code with multiple people
) it will raise a big yellow or red flag and you are warned. Doesn't mean they can't be trading on and off the site at the same time, but it certainly makes it a little more difficult. A case like this which would be okay is in instances where there's say more than one game on a code, but the other person already owns one of them. Example:
User A has Zombie Shooter 1+2 unredeemed.
User B has Zombie Shooter 2 but not 1
User C has Zombie Shooter 1 but not 2.
You could then trade it to both of them, as they could only redeem half of it. The yellow flag will at the very least make the original trader explain why it's being traded multiple times (One of very few cases where this would actually happen