Hey there!
Stripe has some resources on the development side around what is needed for an integration – I am not seeing a specific list of what those files do, and the files are minified so I’m not able to see the exact code myself.
We also have our Stripe repository here: https://github.com/woocommerce/woocommerce-gateway-stripe
This would list where these files are included, and may contain information around why those are included in the product pages.
This is a fairly complex development topic, so I’m also going to leave it open for a bit to see if anyone is able to chime in with additional information to help you out.
I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.
You can also visit the WooCommerce Facebook group or the #developers
channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.
Thank you @fevered .
Silly question, but aren’t you guys the plugin developers? If so, then wouldn’t you know why you place those JS files on those pages?
Nonetheless, I think I have answered my own question here https://stripe.com/docs/js/including – It seems this is used to prevent fraud
Also there seems to be a PR for this to be excluded from Product pages, I don’t suppose you can confirm which version this will be part of? https://github.com/woocommerce/woocommerce-gateway-stripe/pull/2110
That PR was merged on 10 November and is part of Stripe code. It is only meant to exclude the JavaScript resources if payment request buttons aren’t enabled. Is that the case?
@wbrubaker Yes, that’s correct, I do not use the buttons on the product pages so I shouldn’t expect to see these files being called then. Do you know if there is an option to disable it?
Upon closer review of the history of that PR, what was eventually done to close the issue was to provide a filter solution. I’d like to point you to a comment which references Stripe documentation: https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2065#issuecomment-960450052
>Include the Stripe.js script on each page of your site—it should always be loaded directly from https://js.stripe.com, rather than included in a bundle or hosted yourself.
>To best leverage Stripe’s advanced fraud functionality, include this script on every page, not just the checkout page. This allows Stripe to detect suspicious behavior that may be indicative of fraud as customers browse your website.
However, if you wish to bypass that it is possible via implementation of some filters. See: https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2065#issuecomment-974383653
Great, thank you, this is exactly what I was after.