php - Stripe - 结帐不支持没有名称的 SKUS
问题描述
我正在实施条带结帐系统。
每次我尝试调用结帐视图时,我都会遇到一个奇怪的 javascript 错误:IntegrationError: SKUs for Checkout 需要一个name
属性。
在仪表板中,用于结帐集成的按钮显示为灰色。
关于如何在创建 SKU 时传递名称的任何线索?
这是我通过条带 api curl 调用发布 SKU 的 PHP:
$sku = [
'active' => 'true',
'inventory' => ['type' => 'infinite', 'value' => null],
"currency" => "eur",
"price" => $price,
"product" => $stripe_product_id
];
解决方案
经过多次组合,以及对条带 API 的深入分析,找到了我一直在寻找的答案。
产品创作:
$pacoteSMS = [
'name' => $name,
'type' => 'good',
'active' => 'true',
'description' => $description,
"attributes" => [
"name"
],
];
SKU 创建:
$sku = [
'product' => $stripe_product_id,
"attributes" => [
"name" => $name,
],
"price" => $price,
"currency" => "eur",
"inventory" => [
"type" => "infinite",
],
"active" => "true",
];
推荐阅读
- ios - 在 iOS 模拟器中测试核心蓝牙应用程序
- android - 本机 iOS 类中的 j2objc 反射支持
- axios - 搜索 github api 返回不一致的结果
- c - 将 sha256 转换为更小的 uint 类型
- openssl - 生成多个具有相同模数的 RSA 密钥
- java - 是什么导致了这个 ArchUnit 异常?
- arangodb - Arango commitIntervalMsec 和solidationIntervalMsec 以减少等待时间
- java - mongoTemplate executeCommand 错误:未授权
- c# - 设置可以注入的填充对象的最佳方法是什么?
- apache-flink - Flink 流式传输:全局窗口何时开始?