Closed dougaitken closed 3 years ago
Another report of this here 3023025-zen
another report here: 3397389-zen
Also happens for Aland Islands (reported in 25192248-hc)
Bumping to High and L since this happens with any country that isn't a supported Payment Request button country.
Recent forum thread - https://wordpress.org/support/topic/stripe-misbehaves-with-woodmart/#post-13701296
This error is thrown if the country for WooCommerce > Settings > General > Store Address doesn't match the array of supported countries of Stripe - https://stripe.com/global - the error is thrown by Stripe.com JavaScript and not our extension.
Since we don't do a country check for the main plugin activation anymore ( #1288 ), I feel we should be disabling the Payment Request button if Stripe is activated for a non-supported country with a warning similar to #1284 to allow the rest of the functionality to proceed.
Haven't tested or looked too deeply but it seems there are 3 issues that could be tackled separately:
Thanks @dechov for looking into this! Would you be able to open the three issues you're proposing? I'm not sure I understand the case for reverting the deletions, so if you have more context to add to that issue I'd love to read it.
I'm not sure I understand the case for reverting the deletions, so if you have more context to add to that issue I'd love to read it.
@v18 The deletions were part of moving the country check "from payment request to main plugin" in https://github.com/woocommerce/woocommerce-gateway-stripe/pull/1254, reverted in https://github.com/woocommerce/woocommerce-gateway-stripe/pull/1288 except that the country check for Payment Request hasn't been restored – which AFAICT is why this issue is now affecting not only Puerto Rico but any unsupported country as well.
except that the country check for Payment Request hasn't been restored
On purpose. The rationale was that Stripe has been adding countries and previews and even specific merchants that any list is rapidly out of date.
👍 On second thought then, we shouldn't revert that bit – if we just fix the error handling, this won't cause any breakage or be an issue for unsupported countries. In order of priority then:
@v18 They (just two now) are independent fixes, so it does make sense to treat them separately, but I'm not really sure if we need separate issues – or which to break out, since both seem to pertain equally to the issue as reported above 🤔 – or did you mean having child issues to this one?
@dechov - you're talking about this:
Adapt the case of "country: PR" to "country: US" + "state: PR" Stripe.js error breaking variation selection – just need to wrap in try…catch?
Yeh, let's keep 'em in this issue. Assigning as good first issue, it's more complex but also more fun!
I've just come across this same error message:
Uncaught IntegrationError: Invalid value for paymentRequest(): country should be one of the following strings: AE, AT, AU, BE, BG, BR, CA, CH, CI, CR, CY, CZ, DE, DK, DO, EE, ES, FI, FR, GB, GR, GT, HK, HU, ID, IE, IN, IT, JP, LT, LU, LV, MT, MX, MY, NL, NO, NZ, PE, PH, PL, PT, RO, SE, SG, SI, SK, SN, TH, TT, US, UY. You specified: CN.
But my situation seems a bit simpler (not related a question of country/state). My store address is set to CN (China) and I'm using Stripe (HK). Stripe works perfectly if people are able to get through to the checkout screen, but this error is thrown on product pages making it difficult for people to add a product to their cart.
Disabling the Payment Request Buttons
works as a temporary work around.
Turning off Apple Pay and Google Pay fixed this issue for me.
Turning off Apple Pay and Google Pay fixed this issue for me.
it does not fix it for me!... Plus, why sacrifice Apple pay which is so good!? I cannot believe this has not been fixed yet...who can help me!? My clients should not have to see that error message and I should be able to use Klarna!
Describe the bug
When the country for Store Address is something other than the supported countries for Payment Request buttons - set at WooCommerce > Settings > General > Store Address - the variable product functionality breaks and a JS console warning is logged.
Original issue:
WooCommerce considers Puerto Rico as a country* but Stripe designates it as a State of the United States. This means when a WooCommerce site is using the Stripe payment gateway extension and the Payment Request buttons, "we" report this to Stripe via
wc_stripe_supported_countries
as a countryPR
- Stripe then looks on their list and doesn't find it, so it rejects the Payment Request button creation.What also happens at this point is, I think, JavaScript functionality is disabled so variable product selection doesn't work as expected. Both dropdowns work but the Ajax request isn't used to check stock and variation selection. The
Clear
button doesn't work.Disabling the Payment Request buttons from the Stripe payment gateway settings returns the functionality.
Support for
PR
in the Payment Request button was added to Stripe via #845I'm unsure how useful this is but since @DanReyLop mentioned having to create some custom code for other scenarios, I looked for similar and found this - https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout/pull/693
Semi-related - 53-gh-woocommerce/woocommerce-shipping-usps
Context
forum thread prompting this - https://wordpress.org/support/topic/uncaught-integrationerror-invalid-value-for-paymentrequest-country-should-be/#post-12826393
Stripe.com docs link - Puerto Rico is classed as a state but no other unincorporated territory is treated as such, others aren't supported - https://support.stripe.com/questions/stripe-availability-for-outlying-territories-of-supported-countries
Internal Slack - p1589366017120800-slack-C9976E5MJ
To Reproduce Steps to reproduce the behavior:
Expected behavior
As Puerto Rico is supported by Stripe.com, the extension needs to support all available APMs as expected.
Screenshots
Gif - https://d.pr/i/DbHiAj
Environment (please complete the following information):
Additional context Add any other context about the problem here.