wordpress - 通过 Woocommerce Rest API 创建订单时,订单备注显示两个订单状态备注,并且未发送正确的电子邮件
问题描述
通过 WooCommerce REST API 创建订单时遇到问题。有两个问题:
- 订单备注通过桌面创建订单时:-“银行转账”的新订单作为付款创建两个订单备注
- 订单状态从待付款更改为暂停
- 对于订单库存减少
通过手机创建订单时:- 使用“银行转账”作为付款方式的新订单创建三个订单备注:- 1. 订单状态从待付款更改为处理中 2. 订单库存减少 3. 订单状态从待付款更改为暂停
- 客户收到一封带有状态处理的电子邮件,而订单状态为搁置
在创建订单和更新订单付款详细信息时,我尝试从 API 传递订单状态=暂停。但问题仍然存在。
订单创建api
发布 wc-api/v3/orders/
身体
{
"order": {
"customer_id": 6925,
"billing_address": {
"first_name": "Android",
"last_name": "Testing",
"address_1": "Address of Developer",
"address_2": "Cengkareng",
"city": "Jakarta Barat",
"state": "6",
"postcode": "12345",
"country": "ID",
"email": "ankurgecr@gmail.com",
"phone": "1234567890"
},
"shipping_address": {
"first_name": "Android",
"last_name": "Testing",
"address_1": "Address of Developer",
"address_2": "Cengkareng",
"city": "Jakarta Barat",
"state": "6",
"postcode": "12345",
"country": "ID"
},
"line_items": [
{
"product_id": 32776,
"quantity": 1,
"subtotal": 10000,
"total": 10000,
"variations": {
"Color": "Blue"
}
}
],
"fee_lines": [
{
"title": "Rp",
"total": 846
}
],
"shipping_lines": [
{
"method_id": "OKE",
"method_title": "JNE OKE",
"total": 29500
}
],
"is_vat_exempt": false
}
}
订单更新 API
发布 wc-api/orders/[orderID]
身体
{
"order": {
"status": "on-hold",
"payment_details": {
"method_id": "bacs",
"method_title": "Bank Transfer BCA / MANDIRI",
"paid": true
},
"set_paid": true
}
}
客户应收到一封订单状态 = 暂停的电子邮件。
我附上了实际结果的图像。
注意:如果我们从网站结帐中下订单,它工作正常,只有休息 API 有问题。
解决方案
推荐阅读
- reactjs - 添加从内容和 gatsby 生成的可点击标签
- python-3.x - 无法获得窗口,为 kivy 中止
- c++ - 如何为 C++ 项目自动创建构建日志文件
- redux - Redux 状态在页面重新加载时设置为 null
- eclipse - 在 Eclipse 中为 JavaFX 运行配置提供相关 VM 参数
- azure - 如何将带有团队加入 url 链接的短信从 azure logic app design 发送给用户?
- sql - 如何在 SQL Server 中计算立即访问的每一行经过的时间
- python - 如何创建三种不同类型图像的训练数据集(图像),每种图像都有不同类型的名称(在python中)?
- kubernetes - kubernetes:当pod处于CrashLoopBackOff状态时,相关事件不会更新?
- python - 如何添加两个不同维度的数据框?