如何将Chrome扩展MV3与PayPal集成
我如何使用PayPal向用户收取MV3 Chrome扩展中的功能?
我特别寻找贝宝(Paypal),因为我的国家不支持条纹。
这是我第一次试图为任何事情收取钱,所以我希望第一次以正确的方式进行。
另外,我的扩展名是开源的,因此,如果我可以以某种方式制作代码,以防止用户绕过存储以启用该功能而无需付费,那就很酷。
How can I use PayPal to charge users for feature(s) in my MV3 Chrome extension?
I'm specifically looking for PayPal as Stripe isn't supported in my country.
This is the first-ever time I'm trying to charge money for anything, so I wish to do it the right way the first time.
Also, my extension is open-source, so if I could make the code in a certain way to prevent the user from bypassing the storage to enable the feature without paying, it'd be cool.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要防止用户绕过任何内容,则需要提供服务和付款验证的Web服务器。
当前版本的 paypal结帐通常皱眉。因此,最简单的解决方案再次将是将您的扩展名直接转到网页以处理付款。
如果您坚持直接从扩展名处理付款,那么唯一可能的方法是使用旧的html html paypal流,最简单地将一个选项卡打开到链接,例如:
https://www.paypal.com /webcr?cmd = _xclick& item_name =付款%20purpose%20Goes%20 herey&量= 100& currency_code = usd&
将传统IPN服务集成在服务器上(也是一个坏主意)。
因此,总而言之,要执行您想做的事情,您应该将服务器和网页与您的扩展程序配对以进行付款处理/验证。
See the full stack example at https://developer.paypal.com/docs/subscriptions/integrate /,并从服务器的后端进行API调用(在任何编程环境中,节点js只有一个示例)用于创建和捕获。您的2个服务器路由应从您的网页调用,理想情况下使用此批准流< /a>包括一个错误处理代码的示例,以便如果捕获失败。
You need a web server that provides services and payment verification if you want to prevent the user from bypassing anything.
Current versions of the PayPal Checkout require loading external JS resources, which browser extensions typically frown on. So the simplest solution, again, is going to be to have your extension direct over to a web page to handle the payment.
If you insist on processing the payment directly from your extension, the only possible way would be using a legacy HTML-only PayPal flow, most simply opening a tab to a link such as:
https://www.paypal.com/webscr?cmd=_xclick&item_name=payment%20purpose%20goes%20here&amount=100¤cy_code=USD&[email protected]
This would not be at all secure or verifiable, other than perhaps if you were to also integrate the legacy IPN service on a server (also a bad idea).
So in summary, to do what you want to do you ought to pair a server and web page with your extension for payment processing/verification.
See the full stack example at https://developer.paypal.com/docs/subscriptions/integrate/ , and do API calls from your server's backend (in whatever programming environment, the node js there is just an example) for the order creation and capture. Your 2 server routes should be called from your web page, ideally using this approval flow includes a sample of error handling code for if the capture fails.