woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

[Order Creation] On multi-currency sites, orders are created with the user's default currency, not the site's. #12911

Open AnirudhBhat opened 1 week ago

AnirudhBhat commented 1 week ago

Description

We don't specify a currency when we send an order creation API request, assuming it will be created with the site's default currency. In the order creation UI, we always show all amounts in the site's default currency.

However, when the user has a different default currency set for their account, that is used by the API when the order is created.

This will lead to the order being created, but then the currency shown appears to change when the merchant views the order details, compared to what they saw in order creation.

Additionally, the order won't be eligible for In-Person Payments, as the currency won't match the site's currency.

Since we don't give the user a chance to select the currency, and assume the site's default, we should override the API's default by specifying the site's default currency in the request.

Repro

Use a test store with WooPayments installed and active, configured to use the built-in multi-currency functionality. Enable at least 2 currencies.

Set your user's account to have a different default currency than the site's default, by going to {siteurl}/my-account/edit-account/ in a browser, logging in as your user, and selecting a different option.

  1. Launch the app
  2. Switch to your test store
  3. Add an order with items – observe that the site default currency is shown in this UI
  4. Tap Create
  5. Observe that in the order details, your user's currency is shown (amounts are the same.)

Screenshots

https://github.com/user-attachments/assets/de82c64f-bacf-4053-a43e-8138df2f5143

Relates to #12865

dangermattic commented 1 week ago

Thanks for reporting! 👍