gpt4 book ai didi

javascript - 从 react 组件卸载时卸载纯粹的 strip

转载 作者:行者123 更新时间:2023-12-05 06:06:13 27 4
gpt4 key购买 nike

所以,我想摆脱从我的网站发送数据的 Stripe 。

每次点击都在胡说什么

curl 'https://m.stripe.com/6' \
-H 'authority: m.stripe.com' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36' \
-H 'dnt: 1' \
-H 'content-type: text/plain;charset=UTF-8' \
-H 'accept: */*' \
-H 'origin: https://m.stripe.network' \
-H 'sec-fetch-site: cross-site' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://m.stripe.network/' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'cookie: m=db491b6f-636e-4801-a446-c79c62db7d25cd4297; private_machine_identifier=r3F5QQbHA31m%2FqdyaRYQx54%2B%2BhT9pZTlEAm0bKEx832xHQNO8cKhXCLY%2BpBpQHxr6CM%3D; session=sess_IlGtyX7eySNiON53kjkXvE9zPmVWYvWh' \
--data-binary 'JTdCJTIydjIlMjIlM0ExJTJDJTIyaWQlMjIlM0ElMjIzZmJmYzc0MzMwYTY1NTEwM2E3ZjY1NzE2YTA5OTA5NCUyMiUyQyUyMnQlMjIlM0E2NC4xMjUlMkMlMjJ0YWclMjIlM0ElMjI0LjUuMzMlMjIlMkMlMjJzcmMlMjIlM0ElMjJqcyUyMiUyQyUyMmElMjIlM0FudWxsJTJDJTIyYiUyMiUzQSU3QiUyMmElMjIlM0ElMjIlMjIlMkMlMjJiJTIyJTNBJTIyaHR0cHMlM0ElMkYlMkZkWjFMRHZvVExpV0NLclJWZ0l3TFFTdThoX25OSFpZSWVQcEFTZVRHUzB3LjB2RUtlM0c1cFNqUl9sbk5nYnVVMmpVQWNSLVlqSmxzTEE5ZUFkRDRNMDAuZzJ1OS1ocVp2R0lxWUpjUGxQZndKQWYtdjNSZ3lLX3gxTnBwekFsQTEyTSUyRmVJVjZEZ3V6WFAzWlhUZ0J3N2F4d3lZWU9GaXpEZGNkUVVWVkRFSjhhX2slMkZFY3dmdzcxOTJSWVVsT2hXdGZXeG1rT25vNnZMVVZLSWRDUVFrNlNJR3RBJTIyJTJDJTIyYyUyMiUzQSUyMlRqNzI0TVpFUS1abDJ0a2EwWG9ZUVcwM3ZjRlVzVzhJSUxHVm5Jc2VQTm8lMjIlMkMlMjJkJTIyJTNBJTIyODhmYWE5MTgtNmY2OS00MDQ5LWFhNmYtOTg3OTk0MDExYmU3NTQ0MTAyJTIyJTJDJTIyZSUyMiUzQSUyMjg1NjUyOWJiLTA1MTYtNDkyNy05NGRlLTQ4YjYzOTgwMmFjZTFhYTM3MyUyMiUyQyUyMmYlMjIlM0FmYWxzZSUyQyUyMmclMjIlM0F0cnVlJTJDJTIyaCUyMiUzQXRydWUlMkMlMjJpJTIyJTNBJTVCJTIybG9jYXRpb24lMjIlNUQlMkMlMjJqJTIyJTNBJTVCJTVEJTJDJTIybiUyMiUzQTQ2Ni40ODk5OTk5OTE2MDg4JTJDJTIydSUyMiUzQSUyMnRlc3RpbmctYXBwLnNwb3RuYW5hLmNvbSUyMiU3RCUyQyUyMmglMjIlM0ElMjJjMGI4YjE3MzQyNGQyNDU3ODczOSUyMiU3RA==' \
--compressed

所以我从https://mtlynch.io/stripe-recording-its-customers/了解了stripe pure .

一旦安装了支付组件,我就会进行 strip 安装。

loadStripe.setLoadParameters({advancedFraudSignals: false})
loadStripe(process.env.REACT_APP_STRIPE_PUBLISHABLE_KEY??'').then(setStripe);

而且我不知道如何强制删除脚本。所以如果它加载一次,它就会开始做它有趣的事情。

如果再次呈现支付组件,我得到

ERROR: setLoadParameters cannot be called after loadStripe() is called

所以,我想的解决方案很简单,如果我可以在卸载支付组件时卸载 strip 脚本就可以了。有什么建议吗?

或任何可以在这里完成的更好的事情。

最佳答案

您需要在没有 side effects and advanced fraud detection 的情况下导入 Stripe在你的应用程序的根组件中。然后您将按照此处的示例将对 Stripe 的引用作为 Prop 传递:https://github.com/stripe/react-stripe-js#minimal-example .这样,您的代码就不会在每次卸载/重新安装组件时都尝试重新加载 Stripe。

此外,您可能对来自同一作者的更新博客文章感兴趣,内容涉及 Stripe 实现的缓解措施和更多信息:https://mtlynch.io/stripe-update/

关于javascript - 从 react 组件卸载时卸载纯粹的 strip ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65837996/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com