Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not load the payments scripts until actually needed #14682

Open
negue opened this issue May 30, 2023 · 4 comments
Open

Do not load the payments scripts until actually needed #14682

negue opened this issue May 30, 2023 · 4 comments

Comments

@negue
Copy link
Member

negue commented May 30, 2023

I saw that on a normal page (nothing with subscription or anything) stripe and amazon pay was loaded

This needs to be pushed to a point where we actually need em

@lstanford53
Copy link

@negue Hello, I'd be willing to investigate this a bit and see what I can find. Could you let me know the page you were on when stripe and amazon pay were loaded? Was it the home page or another page?

@CuriousMagpie
Copy link
Member

Hi @lstanford53--let's get your other two PRs into production first before adding something else to your plate. The team also needs to do more investigation on this issue to determine the scope of the fix needed--it may be something we prefer to handle internally.

@dsychin
Copy link

dsychin commented Jul 11, 2023

I'm not sure about Amazon pay but Stripe recommends adding their JS on all pages for fraud detection.

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.

@negue
Copy link
Member Author

negue commented Jul 11, 2023

Sorry for the way to late response on this:

@negue Hello, I'd be willing to investigate this a bit and see what I can find. Could you let me know the page you were on when stripe and amazon pay were loaded? Was it the home page or another page?

the file that is always adding the scripts: client/src/lib/payment.js, sure those are at least marked as lazy, but I'd rather save some bytes for each site call 😬

I'm not sure about Amazon pay but Stripe recommends adding their JS on all pages for fraud detection.

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.

Oh, thats good to know - we might need to investigate that further and see what Amazon recommends, maybe that one can be only used on the page it is actually used

We'll need to discuss this internally before continuing on this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants