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

Better handle store currencies that are not supported (159) #82

Closed
jorgeatorres opened this issue Nov 5, 2020 · 5 comments
Closed

Better handle store currencies that are not supported (159) #82

jorgeatorres opened this issue Nov 5, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@jorgeatorres
Copy link
Member

Describe the bug

When the store is set to use a currency that is not supported by PayPal, the gateway still shows as a payment option but payments fail with a non-descriptive error message.

To reproduce

  1. Set your store's currency to one not supported by PayPal, say "Indonesian rupiah (Rp)". This is on WC > Settings > General.
  2. Go to WC > Payments > PayPal. Confirm that everything looks good and the payment gateway can be activated, as if the plugin can be used with this currency.
  3. Go to the frontend and try to pay for a product.
  4. You'll see an error message and the following logged to the error logs:

    2020-11-05T09:17:24+00:00 WARNING [UNPROCESSABLE_ENTITY] The requested action could not be performed, semantically incorrect, or failed business validation. https://developer.paypal.com/docs/api/orders/v2/#error-CURRENCY_NOT_SUPPORTED

Expected behavior

The gateway should show an error message when going to the settings screen and prevent me from activating it if it's not designed to work with my store currency. This is what PayPal Standard shows when you go to WC > Payments > PayPal Standard, for example:

Screen Shot 2020-11-05 at 06 15 26

@a-danae a-danae self-assigned this Nov 23, 2021
@a-danae
Copy link
Contributor

a-danae commented Nov 24, 2021

@jorgeatorres, regarding the expected behavior, I think that makes sense. The behavior for Card processing is different, though. When "PayPal card processing" is enabled and the store's country or currency isn't allowed, we don't include this gateway in the available ones. So, the gateway isn't displayed under WooCommerce -> Settings -> Payments, nor in the checkout, preventing shoppers from trying to pay with it even when the gateway was enabled.

What do you think about implementing this behavior for the PayPal gateway as well?
It'd be consistent with the Card processing gateway, and stores with an unsupported currency wouldn't have the gateway available on upgrade, without the merchant having to disable and enable it to learn that their currency isn't supported.

With this approach, I also think we should display an admin notice like the one you mentioned. I'd find it confusing as a merchant to enable the plugin and don't see any new payment gateways in the WooCommerce settings without any explanation.

Or if we're going with the approach you suggested, I think we should also update the Card processing gateway to behave the same. Just to keep things consistent.

@a-danae
Copy link
Contributor

a-danae commented May 18, 2022

@AlexP11223 @Dinamiko, mind taking over this issue? Also, Jorge won't be around to clarify the questions I left, so we're leaving defining the approach for this to you.

@InpsydeNiklas InpsydeNiklas changed the title Better handle store currencies that are not supported Better handle store currencies that are not supported (159) May 18, 2022
@InpsydeNiklas InpsydeNiklas added the enhancement New feature or request label May 18, 2022
@InpsydeNiklas
Copy link
Member

@a-danae There have been partial improvements in this regard since the last update in this issue.
There are further improvements needed both to the UX as well as to the specific code implementation in the plugin before it could be considered to have full multi-currency support (which includes correctly handling unsupported currencies).
For the time being, the plugin anticipates a supported PayPal currency and merchants may only be provided with a few hints if their currency is not supported.

For example, the error upon using an invalid currency has been changed from:
image
to:
image
Some currencies will render the smart buttons and throw the error above, other currencies will lead to the smart button not rendering at all, preventing possible checkout attempts. The PayPal gateway would still show up though.

Also, the system report includes a section with a currency support indicator:
image

But there isn't yet any notice about an unsupported currency within the plugin settings. The feature we added for the system report will be used as a foundation to further clarify currency compatibility.

With the above-mentioned approach, I see a potential issue with certain multi-currency setups.
Let's assume the default WooCommerce store currency is not supported by PayPal but additional, supported currencies are provided via multi-currency integration.
It would be difficult to reliably get all possible currencies, so we can only really rely on the default currency configured in the WooCommerce General settings tab.

We are looking for a way to make it immediately clear to the user on the plugin settings page when their main currency is not supported but without creating any admin notices.

@a-danae
Copy link
Contributor

a-danae commented May 18, 2022

Thanks for the update @InpsydeNiklas !

For example, the error upon using an invalid currency has been changed from: [image] to: [image]

Cool. That's at least more informative.

It would be difficult to reliably get all possible currencies, so we can only really rely on the default currency configured in the WooCommerce General settings tab.

I agree. This issue only mentions the store's default currency, so we could keep the scope of this issue focused on that 🙂

We are looking for a way to make it immediately clear to the user on the plugin settings page when their main currency is not supported but without creating any admin notices.

Making the incompatibility immediately clear for the merchant sounds good. As a merchant, I don't think I'd look into the system report unless something is clearly going wrong. Do we have an issue for this improvement here on GH? We could close this issue in favor of that one.

@InpsydeNiklas
Copy link
Member

By now, there is also an admin notice on the PayPal Payments settings pages when the merchant has an invalid currency configured:
image
Merchants can still enable the gateway in case they use an unsupported store currency but provide supported secondary currencies via a currency switcher plugin.
There are more multi-currency improvements like #279 or #694, but the current status should satisfy this issue, so I will close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants