在 React js 中集成 Stripe 支付

Riy*_*oni 4 javascript express stripe-payments reactjs

我已经在我的演示 React 项目中使用Stripe实现了付款,并且我使用Express Js作为后端。

现在,我尝试将该演示项目代码合并到我的实际项目中,但在运行时显示错误,如下所示:

CheckoutForm.js?8185:16 Uncaught ReferenceError: 
    regeneratorRuntime is not defined 
Run Code Online (Sandbox Code Playgroud)

所以我用 Google 搜索了这个错误,并将以下依赖项添加到我的 package.json 文件中,但我仍然面临上述错误。

"babel-core": "^6.26.3", 
"babel-polyfill": "^6.26.0",  
"babel-preset-es2015": "^6.24.1", 
"babel-preset-stage-0": "^6.24.1
Run Code Online (Sandbox Code Playgroud)

下面是我的 .babelrc 文件代码。

CheckoutForm.js?8185:16 Uncaught ReferenceError: 
    regeneratorRuntime is not defined 
Run Code Online (Sandbox Code Playgroud)

有人有这个问题的参考链接或解决方案吗?

GoG*_*arl 5

事实上,我昨天在另一个图书馆遇到了这个问题。对我有用的是执行上面所做的操作,但还要在我的应用程序的主入口点组件中导入polyfill:

import 'babel-polyfill';
Run Code Online (Sandbox Code Playgroud)

这可能就是你所缺少的。