woocommerce / woocommerce-gateway-stripe

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

Apple Pay: Misleading message when no shipping methods are available #1314

Open dechov opened 4 years ago

dechov commented 4 years ago

In two (overlapping but distinct) cases, the Apple Pay flow shows a rather unhelpful error message.

WooCommerce core behavior, for context: normally, ("Scenario A") when no shipping methods are available (for the given shipping address) with shippable items in the cart, the Checkout screen doesn't allow placing the order and says:

There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.

But I've observed that ("Scenario B") when no shipping methods (including disabled ones) have been added to any zone, the Checkout screen appears to entirely bypass shipping and allow checkout (even for physical items).

In my testing, the Apple Pay payment flow is somewhat broken/misleading – i.e. says "Shipping address invalid" (even if the address is valid) and doesn't allow proceeding with payment – in Scenario A, and also Scenario B if on the product page.


Scenario A (no shipping methods available for given address):

Click the Apple Pay button and see a misleading message: IMG_8AD1DC9AD383-1 (After adding a shipping method, it works immediately [screenshot].)

I don't know if there's anything we can do about this behavior, since we in fact don't want to allow proceeding with payment in this case, and might not have enough control over how Apple communicates within their UI.

(Testing Google Pay, there was a more helpful message for this scenario, albeit kind of obscured inside the shipping submenu after having completed that step [screenshot].)


Scenario B (no shipping methods set up at all):

The payment request button integration on the Cart screen behaves in a way consistent with the Checkout screen [PHP, JS], allowing the payment through [screenshot)].

On the product page, however, only the product itself is taken into account [PHP, JS] which leads to not allowing payment even though it is allowed by WooCommerce.

On a product page – click the Apple Pay button and it shows a misleading message to the customer ("Shipping address invalid") and doesn't allow proceeding: IMG_6560 (Immediately after adding a shipping method and tapping Apple Pay button again makes it work [screenshot]).

The necessary param is already being passed in the this context but doesn't appear to be used: https://github.com/woocommerce/woocommerce-gateway-stripe/blob/0dbfb70b84ebfe02069e7cb93ea1f2c6858f3463/includes/payment-methods/class-wc-stripe-payment-request.php#L528


Setting low priority due to the likely unexpected (and possibly unintended) scenario of having no shipping methods set when selling physical products (Scenario B), and the low likelihood of being able to control the messaging ("Invalid address") when there are simply no shipping methods available (Scenario A).

v18 commented 3 years ago

@dechov - I can't repro scenario B anymore since the Apple Pay button doesn't show up when no shipping methods are available. Do you see the same?