Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
173 stars 69 forks source link

Postcode / zip code is required not optional #8368

Closed docmartin closed 6 months ago

docmartin commented 7 months ago

Describe the bug

Attempting to make a payment with the postcode/ zip code field blank leads to payment failed message, saying some info is lacking.

To Reproduce

  1. Go to '…' Try making payment
  2. Click on '…' Payment button, after filling in everything except this field.
  3. Scroll down to …'
  4. See error

Actual behavior

That's it really: no postcode/ zip code, the payment fails.

Realised this for store I have targeting Hong Kong, which does not have postcode. [Elsewhere, postcodes / zip codes are commonplace, so users may tend to fill in this field].

A prospective customer had a payment failed, tried with 2 credit cards. I switched to test mode; and found the error occurring.

Then, although the field says "optional", I tried adding "000000" which can work for Hong Kong when postcode is required. And payment worked. The actual payment by customer then worked too, also with "000000" in the postcode field.

Screenshots

This works; field left blank does not.

Screenshot 2024-03-11 at 11 19 26 PM

Expected behavior

Well, expected payment to proceed... ...

Desktop (please complete the following information):

Don't believe this matters; didn't ask what customer uses. For me, with latest Mac 14.2.1, Safari. I didn't try with others, as found the "00000" pseudo code entry worked.

Smartphone (please complete the following information):

Additional context

Hopefully this is enough info, and straightforward enough to resolve. Googling for info, I noticed various people with payment failures, sometimes mysterious. It might be that this is at times the culprit, rather than anything "deeper"?

I think either make this postcode / zip code field actually optional - though of course, if places have postcodes, they can be very helpful.

Or note that should use correct postcode if there is one; and if none, please enter "000000". [as temporary workaround effort, I have added text to this effect to the checkout page, rather than dig into the plugin code, which will change at times anyway\

csmcneill commented 7 months ago

I can reproduce this consistently using the shortcode checkout.

To expand on @docmartin's reproduction steps:

  1. Ensure WooPayments 7.3.0 is active.
  2. Add a product to your cart.
  3. Proceed to the shortcode checkout.
  4. Ship to any address in HK.
  5. Leave the postcode empty (as it is optional).
  6. Attempt to pay for the order with a new card (saved card details will succeed).
  7. Placing the order will produce the following error:
Invalid or missing payment details. Please ensure the provided payment method is correctly entered.

I suspect that this is related to https://github.com/Automattic/woocommerce-payments/issues/8352

Similar reports:

nawaz0705 commented 7 months ago

By default, WooCommerce hides the Postcode / ZIP field on the checkout form when a merchant is selling to specific countries that do not require Postcode / ZIP. I was able to replicate the error in such scenario on my test website with WooPayments version 7.3.0 and the [woocommerce_checkout] shortcode. Reverting to version 7.2.0 or using checkout block instead of the checkout shortcode solved the issue for me.

Another example here: 7880220-zen

Prin-S commented 7 months ago

7878822-zd-a8c

zmaglica commented 7 months ago

@pierorocca it appears that this issue is put on the Shopper Experience maintenance queue. Are you folks looking into this issue? Do you need help from the Gamma team? The reason why I am asking is that I had to triage this issue as a porter and noticed that you folks have some activity on this issue.

pierorocca commented 7 months ago

@zmaglica if the focus label is applied, it will be pulled into our project board automatically and will be triaged by Wednesday eod or earlier. I'd say no need to triage issues already in our board as we're very active.

daniyalahmadk commented 7 months ago

Another report 7904615-zen

gpressutto5 commented 6 months ago

Please add your planning poker estimate with Zenhub @FangedParakeet

EjayhanFernandes commented 6 months ago

8054526-zd-a8c - The user in this ticket experienced this issue on 7.4.0. I can also replicate the issue on 7.4.0 of WooPayments. Having them roll back to 7.2.0.

gpressutto5 commented 6 months ago

@EjayhanFernandes This fix was released with version 7.5.0 a few hours ago.

pierorocca commented 6 months ago

Fabulous @gpressutto5. Does this have any side benefit for express checkouts (Google and Apple Pay)?

gpressutto5 commented 6 months ago

No, this does not affect express checkouts.

csmcneill commented 6 months ago

@francoishvz Can you please follow up with affected merchants and let them know to update to version 7.5.0?