woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
228 stars 201 forks source link

Multi-currency and subscription renewal issues #859

Open james-allan opened 5 years ago

james-allan commented 5 years ago

Affected ticket(s)

WooCommerce.com Request Number 139220 - we've been responding to the customer on our end.

What I expected

I expect that processing a subscription renewal payment with Stripe that the currency will be used and the amount will be charged.

What happened instead

No attempt to collect the renewal payment was made.

Steps to reproduce the issue

There are plenty of ways to replicate this, this is only one, simple way to replicate:

  1. Set up your store to have Euros as the store currency in WooCommerce > Settings
  2. Purchase a 30 € / month subscription product with Stripe.
  3. Change the store currency to Japanese Yen.
  4. Process a renewal for the subscription purchased in step 2 by going to the edit subscription screen and selecting it from the actions dropdown (more info here).
  5. notice that payment for the renewal isn't processed with no error or any note logged.

Looking in the code, the issue comes from this section of code, where because the base currency is now Yen, the minimum Stripe amount is 5000 ¥ and 30 x 100 doesn't reach that requirement. That error is returned and nothing is done with it (here)


lkraav commented 5 years ago

Is this a "multi-currency" thing, though? I've always thought "multi-currency" as store having multiple currencies in use in parallel (which WC doesn't natively support), but this seems to be a store configuration before/after change problem of some kind.

Not sure either if semantics matter that much here, or not.

NickGreen commented 5 years ago

@lkraav In the case that brought this up, the store is using WPML multi-currency plugin, which allows purchases in currencies other than the store base currency. However, this can be reproduced in any case where the renewal occurs in a currency other than the store base currency.

glagonikas commented 5 years ago

@james-allan @NickGreen Can you be a bit more specific on the exact scenarios where this bug can be reproduced? Is this related to the WooCommerce Multi-Currency plugin only?

We are currently testing WPML with their WooCommerce Multilingual plugin on a shop with base currency in GBP. We have enabled the Multi-Currency option of WooCommerce Multilingual and it appears to work fine so far.

I attempted the following

  1. Create a Composite Subscription (WC Composite Products, WC Subscription, WC All Products For Subscriptions) as customer X on the site's default currency (GBP).
  2. Create a Composite Subscription as customer Y on a secondary currency (EUR) where the exchange rate is set to 1.1
  3. Go to admin and "process renewal" for the first subscription
  4. Go to admin and "process renewal" for the second subscription

Both subscriptions renewed correctly. A new order was created, the payment was taken from Stripe and the subscription remained active.

I see no issues in the above flow, but i'd like to establish if you're referring to a different plugin or a flow that i didn't test.

grig-23 commented 4 years ago

In Subscriptions, support for multi-currency plugins was discussed here since 2015:

https://github.com/woocommerce/woocommerce-subscriptions/issues/1040

It looks like our developers decided not to pursue this.

From what I recall, even with no multi-currency plugins, if the site's currency is changed - the renewal will be done in the new currency.