Put app icons in pay JWT (bug 848675)

This commit is contained in:
Kumar McMillan 2013-03-28 17:52:30 -05:00
Родитель 8cd12c2d1d
Коммит a887f101f5
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -61,10 +61,9 @@ class TestPurchase(PurchaseTest):
eq_(req['id'], make_ext_id(self.addon.pk))
eq_(req['name'], unicode(self.addon.name))
eq_(req['description'], unicode(self.addon.summary))
eq_(req['postbackURL'],
absolutify(reverse('webpay.postback')))
eq_(req['chargebackURL'],
absolutify(reverse('webpay.chargeback')))
eq_(req['postbackURL'], absolutify(reverse('webpay.postback')))
eq_(req['chargebackURL'], absolutify(reverse('webpay.chargeback')))
eq_(req['icons']['512'], absolutify(self.addon.get_icon_url(512)))
pd = urlparse.parse_qs(req['productData'])
eq_(pd['contrib_uuid'][0], cn.uuid)
eq_(pd['seller_uuid'][0], self.seller.uuid)

Просмотреть файл

@ -99,6 +99,9 @@ def prepare_pay(request, addon):
acct = addon.app_payment_account.payment_account
seller_uuid = acct.solitude_seller.uuid
issued_at = calendar.timegm(time.gmtime())
icons = {}
for size in amo.ADDON_ICON_SIZES:
icons[str(size)] = absolutify(addon.get_icon_url(size))
req = {
'iss': settings.APP_PURCHASE_KEY,
'typ': settings.APP_PURCHASE_TYP,
@ -115,6 +118,7 @@ def prepare_pay(request, addon):
'productData': urlencode({'contrib_uuid': uuid_,
'seller_uuid': seller_uuid,
'addon_id': addon.pk}),
'icons': icons,
}
}