Closed Bug 1064690 Opened 7 years ago Closed 7 years ago

Unable to save in-app products @ TypeError: price is undefined in_app_products.js:14

Categories

(Marketplace Graveyard :: Payments/Refunds, defect, P2)

x86
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

VERIFIED FIXED
2014-09-16

People

(Reporter: krupa.mozbugs, Assigned: mstriemer)

References

()

Details

Attachments

(1 file)

steps to reproduce:
1. Load https://marketplace.allizom.org/developers/app/fxpay/in-app-products/
2. Add a product (any data works but I listed what I have used)

Image: http://img2-1.timeinc.net/people/i/2013/specials/year-end/best-worst/grumpy-cat-600x450.jpg
Name: babel fish
price tier: $0.40

3. Save the product.

actual behavior:
Saving the in-app product fails with
TypeError: n is undefined in-app-products-min.js:1
POST https://marketplace.allizom.org/api/v1/payments/app%3A//fxpay.allizom.org/in-app/ [HTTP/1.1 404 NOT FOUND 326ms]
As a workaround, you could select $0.99 as the price. Other prices seem to be causing this problem:

price is null at https://github.com/mozilla/zamboni/blob/master/media/js/devreg/in_app_products.js#L14

It looks like it's expecting a currency as USD but not finding it.

Example output from a working price such as $0.99:

{"prices":[{"price":"2060.00","dev":true,"method":2,"currency":"COP","carrier":null,"paid":true,"provider":1,"tier":1,"region":9,"id":572},{"price":"0.89","dev":true,"method":2,"currency":"EUR","carrier":null,"paid":true,"provider":1,"tier":1,"region":8,"id":576},{"price":"0.89","dev":true,"method":2,"currency":"EUR","carrier":null,"paid":true,"provider":1,"tier":1,"region":14,"id":818},{"price":"0.75","dev":true,"method":1,"currency":"GBP","carrier":null,"paid":true,"provider":1,"tier":1,"region":4,"id":784},{"price":"270.00","dev":true,"method":2,"currency":"HUF","carrier":null,"paid":true,"provider":1,"tier":1,"region":13,"id":850},{"price":"15.00","dev":true,"method":2,"currency":"MXN","carrier":null,"paid":true,"provider":1,"tier":1,"region":12,"id":834},{"price":"15.00","dev":true,"method":0,"currency":"MXN","carrier":null,"paid":true,"provider":3,"tier":1,"region":12,"id":865},{"price":"3.99","dev":true,"method":2,"currency":"PLN","carrier":null,"paid":true,"provider":1,"tier":1,"region":11,"id":574},{"price":"0.99","dev":true,"method":1,"currency":"USD","carrier":null,"paid":true,"provider":1,"tier":1,"region":2,"id":740},{"price":"0.99","dev":true,"method":1,"currency":"USD","carrier":null,"paid":true,"provider":1,"tier":1,"region":10,"id":772}],"localized":{"locale":"$0.99","price":"0.99","dev":true,"id":740,"currency":"USD","carrier":null,"paid":true,"provider":1,"tier":1,"region":"United States","method":1},"pricePoint":"10","name":"Tier 10","id":1,"created":"2011-09-29T14:15:05","modified":"2013-05-02T14:43:57","active":true,"price":"0.99","method":2}

Example output from a non-working price such as $0.25:

{"prices":[{"price":"0.25","dev":true,"method":0,"currency":"EUR","carrier":null,"paid":true,"provider":1,"tier":34,"region":8,"id":556},{"price":"0.25","dev":true,"method":0,"currency":"EUR","carrier":null,"paid":true,"provider":1,"tier":34,"region":14,"id":816},{"price":"70.00","dev":true,"method":0,"currency":"HUF","carrier":null,"paid":true,"provider":1,"tier":34,"region":13,"id":848},{"price":"3.75","dev":true,"method":0,"currency":"MXN","carrier":null,"paid":true,"provider":1,"tier":34,"region":12,"id":832},{"price":"3.75","dev":true,"method":0,"currency":"MXN","carrier":null,"paid":true,"provider":3,"tier":34,"region":12,"id":881},{"price":"0.98","dev":true,"method":0,"currency":"PLN","carrier":null,"paid":true,"provider":1,"tier":34,"region":11,"id":554}],"localized":{},"pricePoint":"5","name":"Tier 5","id":34,"created":"2013-04-25T14:13:22","modified":"2013-05-02T14:43:57","active":true,"price":"0.25","method":0}
Summary: Unable to save in-app products @ TypeError: n is undefined in-app-products-min.js:1 → Unable to save in-app products @ TypeError: price is undefined in_app_products.js:14
While I mentioned that there's a workaround for the currency issue, I see that bug 1065006 is a hard blocker on saving products. I wanted to make that a separate bug so we can fix that first.
Priority: -- → P2
https://github.com/mozilla/zamboni/pull/2532
Assignee: nobody → mstriemer
Status: NEW → ASSIGNED
https://github.com/mozilla/zamboni/commit/bde9001e9836b9ab88f7e15ddb83e3b2bb815442
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2014-09-16
Tested this and added a Product for every price point. 
https://marketplace.allizom.org/developers/app/in-app-payments-test/in-app-payments/in-app-products/

This is now verified and fixed!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.