Automattic / woocommerce-payments

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

Refresh cart/checkout page when ECE or PRBs are dismissed #9794

Open frosso opened 1 week ago

frosso commented 1 week ago

Description

When GooglePay/ApplePay dialogs are triggered on the cart or checkout pages (both shortcode and block-based), the customer's shipping address is submitted to the backend to update the cart. Within these dialogs, the customer can further interact with the ECE, such as:

If the customer dismisses the payment dialog without completing the payment, the underlying cart/checkout page remains in its original state without reflecting any updates from the GooglePay/ApplePay dialog interaction.

This behavior leads to an inconsistency: the changes appear lost on the cart/checkout page but are correctly stored and shown after a page refresh or navigation.

To improve user experience and maintain state consistency:

This affects both blocks and shortcode implementation. This affects both cart and checkout pages.

https://github.com/user-attachments/assets/dac977c2-2dbc-429d-96f3-fc718cb4f7b4

Acceptance criteria

Designs

N/A

Testing instructions

  1. As a merchant, enable GooglePay/ApplePay in the WooPayments settings
  2. As a merchant, ensure you have a couple of shipping options
  3. As a customer, add a physical product to the cart
  4. Navigate to the cart/checkout page
  5. Enter an address to get some shipping rates
  6. Select a shipping rate
  7. Click the GooglePay/ApplePay buttons to trigger their dialog
  8. Interact with the addresses to get different shipping rates
  9. Select a different shipping rate
  10. Dismiss the dialog
  11. Confirm that the underlying page either reverts to the pre-dialog state or reflects the updated state correctly without requiring a refresh
  12. Manually refresh the page to ensure the previous information is persisted
  13. Complete a payment using ECE to ensure the payment flow remains unaffected by the enhancement
  14. Verify that the correct shipping details and order totals are submitted during the payment process

Dev notes

Additional context

bborman22 commented 3 days ago

Hey team! Please add your planning poker estimate with Zenhub @asumaran @cesarcosta99 @lovo-h @rafaelzaleski @reykjalin @ricardo