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

Store: REST API endpoints don't return prices in the correct currency when locale parameter is available in the request #3518

Closed
daniloercoli opened this issue Feb 23, 2016 · 7 comments
Assignees
Labels
API [Feature Group] WPCOM Store & Purchases All things billing on WordPress.com. This includes the backend store, plans, and billing management. [Type] Bug

Comments

@daniloercoli
Copy link

The call to the Plans endpoint available here https://public-api.wordpress.com/rest/v1.2/plans/?pretty=true&locale=it doesn't take in consideration the parameter locale when outputting the cost, formatted_price, and price fields in the response. It always uses a "default" currency (GBP).

Example response:

  {
        "product_id": 1003,
        "product_name": "WordPress.com Premium",
        "product_name_en": "WordPress.com Premium",
        "prices": {
            "USD": 99,
            "NZD": 139,
            "AUD": 129,
            "CAD": 129,
            "JPY": 11800,
            "EUR": 99,
            "GBP": 85
        },
        "product_name_short": "Premium",
        "product_slug": "value_bundle",
        "tagline": "Perfect for bloggers, creatives, and other professionals",
        "shortdesc": "Il tuo nome di dominio, potenti opzioni di personalizzazione e tanto spazio per audio e video.",
        "description": "Ottieni tutte queste fantastiche funzioni per incrementare la popolarit\u00e0 del tuo blog. Comprende un nome di dominio di tua scelta o una mappatura per un dominio esistente, VideoPress, Custom Design, Space Upgrade da 10 GB e No Ads.",
        "icon": "",
        "capability": "manage_options",
        "cost": 85,
        "bill_period": 365,
        "product_type": "bundle",
        "available": "yes",
        "store": 0,
        "features_highlight": [
            {
                "items": [
                    "custom-design",
                    "videopress",
                    "support",
                    "space",
                    "custom-domain",
                    "no-adverts\/no-adverts.php"
                ]
            },
            {
                "title": "Included with all plans",
                "items": [
                    "free-blog"
                ]
            }
        ],
        "width": 500,
        "height": 250,
        "multi": 0,
        "support_document": "bundles",
        "bundle_product_ids": [
            9,
            12,
            45,
            15,
            5,
            16,
            6,
            46,
            54
        ],
        "bill_period_label": "all'anno",
        "price": "\u00a385",
        "formatted_price": "\u00a385",
        "raw_price": 85
    },

The price is specified in GBP, and not in EUR.

Same problem on the call to the REST Endpoint that returns available Plans for a single site
https://public-api.wordpress.com/rest/v1/sites/$siteID/plans?locale=it

{"1":{"raw_price":0,"formatted_price":"$0","raw_discount":0,"formatted_discount":"$0","product_slug":"free_plan","product_name":"WordPress.com Free","current_plan":true,"id":null},"1003":{"raw_price":99,"formatted_price":"$99","raw_discount":0,"formatted_discount":"$0","product_slug":"value_bundle","product_name":"WordPress.com Premium","can_start_trial":true},"1008":{"raw_price":299,"formatted_price":"$299","raw_discount":0,"formatted_discount":"$0","product_slug":"business-bundle","product_name":"WordPress.com Business","can_start_trial":true}}

This time prices are returned in US Dollars.

@daniloercoli daniloercoli added [Type] Bug API [Feature] Plans & Upgrades All of the plans on WordPress.com and flow for upgrading plans. [Pri] High [Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. [Feature Group] WPCOM Store & Purchases All things billing on WordPress.com. This includes the backend store, plans, and billing management. labels Feb 23, 2016
@daniloercoli daniloercoli changed the title Store REST endpoints doesn't return prices in the correct currency when locale parameter is in the request Store REST endpoints doesn't return prices in the correct currency when locale parameter is available in the request Feb 23, 2016
daniloercoli referenced this issue in wordpress-mobile/WordPress-Android Feb 23, 2016
@fabianapsimoes fabianapsimoes removed [Feature] Plans & Upgrades All of the plans on WordPress.com and flow for upgrading plans. [Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. labels Feb 25, 2016
@hoverduck
Copy link
Contributor

14Apr16 Bug Scrub

Confirmed this is still an issue.

@lancewillett lancewillett changed the title Store REST endpoints doesn't return prices in the correct currency when locale parameter is available in the request Store: REST API endpoints don't return prices in the correct currency when locale parameter is available in the request May 4, 2016
@rralian
Copy link
Contributor

rralian commented May 5, 2016

@scruffian what do you think about this one? I'm not sure we would want to use the locale to determine currency. You could be in the US using dollars, but prefer to manage your site in a different language. Is there a separate site setting we use to determine the correct currency?

@rralian
Copy link
Contributor

rralian commented May 5, 2016

@scruffian If you think this requires active development, can you put this into the appropriate milestone?

@scruffian
Copy link
Member

I agree, we shouldn't base prices on locale - it should be a user setting. I'm going to defer to @peterbutler on this one, since this is more his area...

@lancewillett
Copy link
Contributor

Removed priority label since no activity from May 2016 until now.

@hoverduck
Copy link
Contributor

#bug-scrub

There hasn't been any activity on this thread in 7 months. Is this still a change worth pursuing or should we close it?

@peterbutler you were the last one pinged here, what are your thoughts?

@scruffian
Copy link
Member

I think we should close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API [Feature Group] WPCOM Store & Purchases All things billing on WordPress.com. This includes the backend store, plans, and billing management. [Type] Bug
Projects
None yet
Development

No branches or pull requests

7 participants