stripe-payments - 条纹支付费用
问题描述
我想使用paymentMethod作为来源收取付款但它不收费,我如何使用支付方式获得token作为来源?我尝试使用
\Stripe\Stripe::setApiKey('sk_test_**************');
\Stripe\Charge::create([
'amount' => $menuPrice*100,
'currency' => 'usd',
'customer' => $user->stripe_id,
'source' => 'pm_*************'
]);
解决方案
收费是较老的方式。新方法是付款意图(使用付款方式)。您可以在此处了解差异:https ://stripe.com/docs/payments/payment-intents/migration
推荐阅读
- typescript - 我无法在 React Native 中使用 styled-components 开玩笑
- angularjs - AngularJS 到 Angular12 的迁移(错误:无法解析 AppModule 的所有参数:(?))
- android - 无法使用 hilt 依赖注入注入应用程序上下文
- c++ - 在 Linux 机器中使用 CMakeSettings.json 指定 Qt 版本
- c# - 如何将文件和文件夹保存在一般列表中?
- javascript - 如何使用 jquery ui 调整大小为指示水平图表的日期以增加/减少 rails6 中的开始/结束日期
- pdf - Rmarkdown 正在针织 PDF 中打印乳胶代码
- javascript - 如何仅映射图像源属性的一部分
- python-3.x - 想要获取下一行输入字符串中输入的每个单词
- html - 通过“a”标签下载的图像