Release testing instructions for the WooCommerce Stripe payment gateway 5.5.0 - woocommerce/woocommerce-gateway-stripe GitHub Wiki

Use plugin settings for configuring Payment Request Button locations

Note: There are several aspects to the testing, which is why this test has several subsections.

Note: The testing here requires you to create a new testing site and start with version 5.4.0 (the current version) of the Stripe payment gateway and upload the new testing release later during almost every test.

Note: You may see deprecation warnings if you have WP_DEBUG set to true while the code snippets (added later) are enabled.

Make sure default values work as intented

  1. Create a new testing site.
  2. Install the new test release of the Stripe payment gateway.
  3. Open WooCommerce > Settings > Payments > Stripe – Credit Card (Stripe)
  4. Make sure the Payment Request Button Locations setting is set to Cart and Product.
  5. Make sure the PRBs are loaded on the Product pages.
  6. Make sure the PRBs are loaded on the Cart page (both Blocks and Shortcode versions).
  7. Make sure the PRBs are not loaded on the Checkout page (both Blocks and Shortcode versions).

Make sure filter (snippet) configuration is persisted

  1. Create a new testing site and install version 5.4.0 of the Stripe payment gateway.
  2. Install and activate the Code Snippets plugin.
  3. Go to Snippets > Add new.
  4. Copy the following snippet into the Code text area. Save this snippet as Show PRBs on the Checkout Page.
// Snippet name: Show PRBs on the Checkout Page.
function show_prb_on_checkout_page($should_show) {
	return true;
}
add_filter( 'wc_stripe_show_payment_request_on_checkout', 'show_prb_on_checkout_page' );
  1. Make sure Run snippet everywhere is toggled on.
  2. Click Save changes and activate.
  3. Repeat the snippet creation and activation for the following 2 snippets; make sure both are in separate snippets with distinct names:
// Snippet name: Hide PRBs on Product Pages.
function hide_prb_on_product_page( $hide_prb ) {
	return true;
}
add_filter( 'wc_stripe_hide_payment_request_on_product_page', 'hide_prb_on_product_page' );
// Snippet name: Hide PRBs on the Cart Page.
function hide_prb_on_cart_page( $should_show_prb ) {
	return false;
}
add_filter( 'wc_stripe_show_payment_request_on_cart', 'hide_prb_on_cart_page' );
  1. You should now have 3 snippets active:
  1. Install the new test release of the Stripe payment gateway.
  2. Open Snippets and disable all active snippets.
  3. Open WooCommerce > Settings > Payments > Stripe – Credit Card (Stripe)
  4. Make sure the Payment Request Button Locations option is set to Checkout.
  5. Make sure the PRBs are loaded on the store's Checkout page (both Blocks and Shortcode versions).
  6. Make sure the PRBs are not loaded on the store's Cart page (both Blocks and Shortcode versions).
  7. Make sure the PRBs are not loaded on any of the store's Product pages.

Now repeat this test with all possible combinations of the snippets enabled/disabled in step 8. Here's a table to help guide you through which filters should be enabled, and the results you should expect

Show PRBs on the Checkout Page Hide PRBs on Product Pages Hide PRBs on the Cart Page PRB locations displayed
Checkout
Cart, Checkout
Product, Checkout
-
Product, Cart, Checkout
Cart
Product
Product, Cart

Make sure settings are respected

Note: It's perfectly fine to create a new testing site for this test, but it's not necessary; you can use the same site you used in the previous test, just make sure you disable all the code snippets.

  1. Open WooCommerce > Settings > Payments > Stripe – Credit Card (Stripe)
  2. Choose any combination of Product, Cart, and Checkout as the value for Payment Request Button Locations.
  3. Click Save changes
  4. Make sure the Payment Request Buttons are only loaded on the pages you chose.

Repeat the testing instructions with all possible combinations of the PRB locations:

  1. No locations selected.
  2. Product.
  3. Cart.
  4. Checkout.
  5. Product, Cart.
  6. Product, Checkout.
  7. Cart, Checkout.
  8. Product, Cart, Checkout.

Make sure filters (snippets) taking precedence over plugin settings

Note: It's perfectly fine to create a new testing site for this test, but it's not necessary; you can use the same site you used in the previous test, just make sure you disable all the code snippets.

  1. Open WooCommerce > Settings > Payments > Stripe – Credit Card (Stripe)
  2. Enable Product and Cart in the Payment Request Button Locations option.
  3. Open Snippets and enable all the Code Snippets you added during one of the previous tests.
  4. Make sure the PRBs are loaded on the store's Checkout page (both Blocks and Shortcode versions).
  5. Make sure the PRBs are not loaded on the store's Cart page (both Blocks and Shortcode versions).
  6. Make sure the PRBs are not loaded on any of the store's Product pages.