Skip to content

Release testing instructions for WC Payments 5.3.0

Dat Hoang edited this page Jan 6, 2023 · 4 revisions

Store order ID to session, check it before update/create_confirm intents PR #5247

This PR primary aim is to prevent creating duplicate orders.

Setup

  • Add this snippet to your site https://gist.github.com/htdat/8971b603ea0ab4fe07474a7a7b30000c. You can add it with plugin Code Snippets or directly to the bottom of file woocommerce-payments.php in the plugin file. Remember to remove the first line <?php; otherwise, it can create a fatal error. This snippet has two purposes:

    • (1) Stimulate errors that customers can face when trying to check out an order.
    • (2) Display the current session value for wcpay_processing_order at http://test-site.url/?dump_session
  • Log into an existing account.

  • When you're asked to make a payment, please randomly choose between two testing cards: 4242424242424242 (basic) and 4000002760003184 (3DS).

Test cases:

Please test 4 scenarios:

  • Non-UPE flow, classic checkout.
  • Non-UPE flow, block checkout.
  • UPE flow, classic checkout.
  • UPE flow, block checkout.

Testing steps

  • Add some products to the cart, visit to the checkout page.

  • Open a new tab, visit http://test-site.url/?dump_session. Confirm that Nothing stored.

  • Make a payment in the checkout page.

  • See an error due to our snippet

    • For non-UPE flow: See an error in the checkout page.
    • For UPE flow: see that the maybe_process_upe_redirect process was interrupted.
  • Visit this tab again http://test-site.url/?dump_session - it should display the progressing order_id, e.g. xyz.

  • Open another tab, check in WP Admin -> Orders, this progressing order_id xyz is precisely the newest order. After a while, this order xyz should be changed to Processing/Paid.

  • Go back to the checkout tab, attempt to make another payment.

  • Get redirected to order-received page of order xyz with this parameter wcpay_paid_for_previous_order=yes, which includes a blue notice message, something like this screenshot.

  • Check this order xyz in WP Admin, see a note like this: WooCommerce Payments: detected and deleted order ID abc, which has duplicate cart content with this order.. Order ID abc is different from xyz and usually bigger than xyz.

  • Visit http://test-site.url/?dump_session - confirm that Nothing stored.

After finishing all tests

Remove or deactivate the snippet added in the Setup step.

Check intent attached to order before processing payment PR #5346

Setup

  • Add this snippet to your site https://gist.github.com/htdat/6a52eec1be77b8442ac05401908a3627 (Note: this one is slighly different from the snippet in PR 5247). You can add it with plugin Code Snippets or directly to the bottom of file woocommerce-payments.php in the plugin file. Remember to remove the first line <?php; otherwise, it can create a fatal error. This snippet tries to stimulate errors that customers can face when trying to check out an order.
  • When you're asked to make a payment, please randomly choose between two testing cards: 4242424242424242 (basic) and 4000002760003184 (3DS).

Special note for non-UPE flow with the basic card.

Before starting the test, please try to edit woocommerce-payments.php with this diff https://gist.github.com/htdat/09eef1ed0cbeec50a5354ca8da38d623

If that's not possible, please use only 3DS card when testing non-UPE flow.

Test cases:

Please test 4 scenarios:

  • Non-UPE flow, classic checkout.
  • Non-UPE flow, block checkout.
  • UPE flow, classic checkout.
  • UPE flow, block checkout.

Testing steps

  • Add some products, visit to the checkout page.
  • Try to make an payment in the checkout page.
  • See an error due to our snippet (trying to replicate potential issues that real customers can get).
  • See this order (usually the newest order) in WP Admin > Order, confirm that it has not been paid.
  • Try to make another payment again.
  • Get redirected to order-received page of this order with this parameter wcpay_previous_successful_intent=yes, like this screenshot.

After finishing all tests

Remove or deactivate the snippet added in the Setup step.

Clone this wiki locally