shopify - 在结帐时更新折扣代码时出现 Shopify 400 错误
问题描述
我正在使用 shopify python api 在结帐时更新折扣代码。以下是步骤 -
#Retrieve the checkout using
checkout = shopify.Checkout.find('6ad53674ac258e67cac363921af7d6c2')
#update the discount code,
checkout.discount_code = 'CADAD12'
#Save the checkout
checkout.save()
保存结帐时出现以下错误,
响应(code=400,body="{"errors":{"credit_card":"must be a hash"}}")
请帮助解决这个问题。
另外,如果有任何其他方法可以使用 shopify_python_api 将折扣代码应用于结帐,请告诉我
解决方案
推荐阅读
- sql-server - 如何在 SQL Server Management Studio 中使用连接字符串关键字连接到本地 SQL Server?
- kubernetes - “kubectl rollout restart deploy”会导致停机吗?
- django - Django - 为每个 M2M 字段选择项目
- dataweave - 在 Dataweave 2.0 中添加默认命名空间的其他方法?
- r - r中的Highcharter Maps,如何通过数据中的变量使地图点变暗
- excel - 嵌套 IF & Do Until 循环 | VBA
- vb.net - 如何制作一个恒定的代理检查器
- python-3.x - 如何限制用户访问 django 中的管理面板?
- c++ - 如何将对象作为非引用参数传递而不能更改其私有变量
- javascript - 模板中的Django移动变量