Return a different status code for "already purchased"

VERIFIED FIXED in 2013-07-25

Status

Marketplace
Payments/Refunds
P4
normal
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: Andy McKay, Assigned: davidbgk)

Tracking

2013-07-25
x86
Mac OS X
Points:
---

Details

(Reporter)

Description

5 years ago
If an app has already been purchased and you hit the payments flow again, we get a 403 response back. That's not really descriptive for the front end and we aren't forbidding the request... we are just saying you shouldn't be calling this API.

Perhaps a 409 would be better and more descriptive.
(Reporter)

Comment 1

5 years ago
Note: this is in zamboni, the has_purchased decorator is used:

https://github.com/mozilla/zamboni/blob/master/apps/addons/decorators.py#L64

When this API is hit:

https://github.com/mozilla/zamboni/blob/master/mkt/webpay/resources.py#L35

Please ensure you update the docs for API to reflect this:

http://firefox-marketplace-api.readthedocs.org/en/latest/topics/payment.html#preparing-payment
Assignee: nobody → david
(Assignee)

Comment 2

5 years ago
To me the issue is related to the `has_not_purchased` decorator:

https://github.com/mozilla/zamboni/blob/master/apps/addons/decorators.py#L93

which decorates the `_prepare_pay` function related to the previously mentioned resource:

https://github.com/mozilla/zamboni/blob/master/mkt/purchase/webpay.py#L73

Am I missing something?
(Reporter)

Comment 3

5 years ago
(In reply to David Larlet [:davidbgk] from comment #2)
> To me the issue is related to the `has_not_purchased` decorator:

No, you are correct, sorry about that.
(Assignee)

Comment 4

5 years ago
https://github.com/mozilla/zamboni/commit/a6d0b9238fce37ea07e63dfeca86d240ee0051ca
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2013-07-25

Comment 5

5 years ago
David,can you please add some specific STRs for this bug or mark it as [qa-] ?
Flags: needinfo?(david)
(Assignee)

Updated

5 years ago
Flags: needinfo?(david)
Whiteboard: qa-

Comment 6

5 years ago
trying to reinstall a previously purchased app now returns a 409 and triggers an install.

marketplace.allizom.org -> POST /api/v1/webpay/prepare/?_user=blahblah&carrier=telefonica&dev=firefoxos&device=firefoxos&lang=en-US&pro=fbff7fdc.32.1&region=co)
I/PRLog   (  109): 2013-08-05 19:53:53.977168 UTC - 1130944[40404470]: http response [
I/PRLog   (  109): 2013-08-05 19:53:53.977259 UTC - 1130944[40404470]:   HTTP/1.1 409 CONFLICT
Status: RESOLVED → VERIFIED
Whiteboard: qa-
You need to log in before you can comment on or make changes to this bug.