Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added store module #22

Merged
merged 2 commits into from
Nov 16, 2015
Merged

added store module #22

merged 2 commits into from
Nov 16, 2015

Conversation

Derfirm
Copy link

@Derfirm Derfirm commented Nov 16, 2015

Added interface for steam purchases.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.38% when pulling ed66fcf on Derfirm:steamapi-store into 6b5a131 on smiley:master.

@smiley
Copy link
Owner

smiley commented Nov 16, 2015

Which store does this implement? Main Steam store (games, DLC, etc.) or the marketplace? (cards, CS:GO skins, TF2 items, etc.)

@Derfirm
Copy link
Author

Derfirm commented Nov 16, 2015

It's implement in-game purchases (without web purchase) .
Steam calls it "microtransactions".

@smiley
Copy link
Owner

smiley commented Nov 16, 2015

Do these actually go through somehow? How do you authorize a transaction without an authenticated Steam ID? (Or is the steamid pre-authenticated somehow?)

@Derfirm
Copy link
Author

Derfirm commented Nov 16, 2015

for my game I use authentication using the ticket:

def retrieve_user(ticket, appid):
    return APIConnection().call("ISteamUserAuth", "AuthenticateUserTicket", "v1", appid=appid,    ticket=ticket)

where ticket is Ticket from GetAuthSessionTicket. (client)
after that, I check errors and get steamid

if hasattr(user_params, 'error'):
    return {'rc': 2, 'steamerrorcode':  user_params.error.errorcode}
steamid = user_params.params.steamid

from .core import APIConnection


class SteamStore(object):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is used for the in-game item stores, rename this to something more specific, like SteamIngameStore. (I plan to add an API for the main store someday)

@smiley
Copy link
Owner

smiley commented Nov 16, 2015

Ah, got it. I've added a few notes to fix-up; correct those and I'll merge this in!

@landscape-bot
Copy link

Code Health
Repository health increased by 0.48% when pulling 0d8fa91 on Derfirm:steamapi-store into 6b5a131 on smiley:master.

@smiley
Copy link
Owner

smiley commented Nov 16, 2015

One last question: why is quantity & description specified with a [0]? Is it because the API can accept more than one object in the same transaction?

@Derfirm
Copy link
Author

Derfirm commented Nov 16, 2015

excerpt from In-Game Purchasing Integration Guide

LINEITEM             
    itemid[n]
    qty[n]  
    amount[n]   
    description[n]  
    category[n] 
END LINEITEM

An order may have any number of Lineitem entries
and “n” is the zero based index of the Lineitem.
so yes, This command allows you to create a shopping cart of one or more items for a user)

smiley added a commit that referenced this pull request Nov 16, 2015
Merged in initial support for the Steamworks in-game micro-transactions store by @Derfirm.
@smiley smiley merged commit 2530bb7 into smiley:master Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants