-
Notifications
You must be signed in to change notification settings - Fork 206
Release testing instructions for the WooCommerce Stripe payment gateway 5.5.0
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 totrue
while the code snippets (added later) are enabled.
- Create a new testing site.
- Install the new test release of the Stripe payment gateway.
- Open WooCommerce > Settings > Payments > Stripe – Credit Card (Stripe)
- Make sure the Payment Request Button Locations setting is set to Cart and Product.
- Make sure the PRBs are loaded on the Product pages.
- Make sure the PRBs are loaded on the Cart page (both Blocks and Shortcode versions).
- Make sure the PRBs are not loaded on the Checkout page (both Blocks and Shortcode versions).
- Create a new testing site and install version 5.4.0 of the Stripe payment gateway.
- Install and activate the Code Snippets plugin.
- Go to Snippets > Add new.
- 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' );
- Make sure Run snippet everywhere is toggled on.
- Click Save changes and activate.
- 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' );
- You should now have 3 snippets active:
- Install the new test release of the Stripe payment gateway.
- Open Snippets and disable all active snippets.
- Open WooCommerce > Settings > Payments > Stripe – Credit Card (Stripe)
- Make sure the Payment Request Button Locations option is set to Checkout.
- Make sure the PRBs are loaded on the store's Checkout page (both Blocks and Shortcode versions).
- Make sure the PRBs are not loaded on the store's Cart page (both Blocks and Shortcode versions).
- 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 |
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.
- Open WooCommerce > Settings > Payments > Stripe – Credit Card (Stripe)
- Choose any combination of Product, Cart, and Checkout as the value for Payment Request Button Locations.
- Click Save changes
- 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:
- No locations selected.
- Product.
- Cart.
- Checkout.
- Product, Cart.
- Product, Checkout.
- Cart, Checkout.
- Product, Cart, Checkout.
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.
- Open WooCommerce > Settings > Payments > Stripe – Credit Card (Stripe)
- Enable Product and Cart in the Payment Request Button Locations option.
- Open Snippets and enable all the Code Snippets you added during one of the previous tests.
- Make sure the PRBs are loaded on the store's Checkout page (both Blocks and Shortcode versions).
- Make sure the PRBs are not loaded on the store's Cart page (both Blocks and Shortcode versions).
- Make sure the PRBs are not loaded on any of the store's Product pages.