Skip to content

some updates for the most most recent version of the unity store #1

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions AssetStoreAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def __init__(self, data):
'rating':int(data['rating']['average']),
'ratingCount':int(data['rating']['count']),
'payoutCut':data['payout_cut'],
'publisherUrl':data['long_url'],
'publisherUrl':data['short_url'],
'publisherShortUrl':data['short_url'],
'siteUrl':data['url'],
'supportUrl':data['support_url'],
Expand Down Expand Up @@ -320,17 +320,26 @@ def __init__(self, data):
self.data = {
'id':data[0],
'packageName':data[1],
'date':self.ParseDate(data[2]),
'isRefunded':data[3] == 'Yes',
'purchase_count':int(data[2]),
'purchase_cost':float(data[3]),
'date':self.ParseDate(data[4]),
'isRefunded':data[5] == 'Refunded',
'status':data[5]
}
def GetInvoiceNumber(self):
return self.data['id']
def GetPackageName(self):
return self.data['packageName']
def GetPurchaseDate(self):
return self.data['date']
def GetPurchaseCost(self):
return self.data['purchase_cost']
def GetPurchaseCount(self):
return self.data['purchase_count']
def IsRefunded(self):
return self.data['isRefunded']
def GetStatusCode(self):
return self.data['status']
class SalesPeriod(object):
def __init__(self, data):
self.year = int(data['value'][0:4])
Expand All @@ -340,8 +349,8 @@ def GetYear(self):
def GetMonth(self):
return self.month
def GetDate(self):
import datetime, time
return time.mktime(datetime.datetime(self.year, self.month, 1, 0, 0, 0, 0).timetuple())
import datetime, time
return time.mktime(datetime.datetime(self.year, self.month, 1, 0, 0, 0, 0).timetuple())

class PeriodSalesInfo(object):
def __init__(self, packageSales, payoutCut = 0.7):
Expand Down Expand Up @@ -420,7 +429,7 @@ def __init__(self, data):
'firstDownload':self.ParseDate(data[2]) if data[2] != None else None,
'lastDownload':self.ParseDate(data[3]) if data[3] != None else None,
'shortUrl':data['shortUrl'],
}
}
def GetPackageName(self):
return self.data['name']
def GetQuantity(self):
Expand Down Expand Up @@ -466,7 +475,7 @@ def __init__(self, data):
'version': data['version_name'],
'categoryId': int(data['category_id']),
'releaseNotes': data['publishnotes']
}
}
def GetName(self):
return self.data['name']
def GetStatus(self):
Expand Down
Binary file added AssetStoreAPI.pyc
Binary file not shown.
10 changes: 6 additions & 4 deletions AssetStoreWebGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,21 @@ def GenPackageHtml(self, client):
return html

def GenInvoiceHtml(self, client, invoiceNumbers):
html = '<h2>Verify invoice</h2>Enter comma separated invoice numbers:'
html = '<h2>Verify invoice</h2>Enter comma separated invoice numbers or order numbers:'
html += '<input type=\"text\" name=\"invoiceNumbers\" value=\"%s\" size=\"13\">'%invoiceNumbers
html += '<input type=\"submit\" value=\"Verify\">'
if len(invoiceNumbers) > 0:
html += '<table><tr><th>Invoice #</th><th>Package</th><th>Purchase</th><th>Refunded?</th></tr>'
html += '<table><tr><th>Invoice #</th><th>Package</th><th>Purchase Date</th><th>Purchase Count</th><th>Purchase Cost</th><th>Status?</th></tr>'
invoiceNumbersArray = invoiceNumbers.split(',')
invoiceNumbersInfo = client.VerifyInvoice(invoiceNumbersArray)
for value in invoiceNumbersInfo:
html += '<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%(
html += '<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%(
value.GetInvoiceNumber(),
value.GetPackageName(),
datetime.fromtimestamp(value.GetPurchaseDate()).strftime('%d %B %Y'),
'Yes' if value.IsRefunded() else 'No')
str(value.GetPurchaseCount()),
str(value.GetPurchaseCost()),
value.GetStatusCode())
html += '</table>'
return html

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(This fork is temporary and should only exist while I make the updates needed for it to work with changes that ahve occurred since it's last official update.)

# Unity-Publisher-API-Python
A Python client for Unity Asset Store publisher interface

Expand Down