angularjs-stripe icon indicating copy to clipboard operation
angularjs-stripe copied to clipboard

[gdpr] [lazy-load] Conditionally include Stripe.js

Open vovafeldman opened this issue 7 years ago • 4 comments

Hi @bendrucker,

When Stripe.js is loaded it automatically adds 2 cookies. To comply with GDPR, the first time an EU visitor opens a page, we are not allowed to set any cookies, so we have built a small library that wraps all 3rd party scripts to conditionally include the script. The problem we're facing is that we can't figure out how to use your Angular module in a way that it will not rely on the existence of Stripe.js upon module injection. When trying with older versions of the module, it fails to initiate the module unless stripe.js is already loaded. The latest version automatically injects the script upon initiation.

Is there any way we can still enjoy the benefits of your module while including Stripe.js conditionally when we actually need to use it on the page?

Thanks a lot!

vovafeldman avatar May 13 '18 12:05 vovafeldman

Hmm, I don't think so.

You could submit PRs to the upstream modules to allow true lazy loading upon call instead of eagerly loading. Happy to review those if you want to invest the time. This would be undesirable to most users (it might put a large/unreliable download in the critical path of clicking a "Buy" button) so I'd leave it off by default.

Maybe Stripe needs to think about modifying their library to not set cookies on load. Worth contacting their support. It puts a fairly extreme burden on users to have to code around that in exchange for tracking/fraud tools that presumably Stripe far more than you.

bendrucker avatar May 13 '18 14:05 bendrucker

Thanks - will contact Stripe.

vovafeldman avatar May 13 '18 17:05 vovafeldman

Cool, I'll at least leave this open until we have an official comment from Stripe on this behavior. I think it's highly undesirable to work around this on a wrapper library level but I at least want to be aware of Stripe's plans.

bendrucker avatar May 14 '18 20:05 bendrucker

Hi , anybody knows if Stripe has implemented a solution to this issue in their V3 version? . thanks

rhaouari avatar Jun 11 '20 10:06 rhaouari