收藏
回答

视频号交易组件,创建订单,报错,订单金额计算错误?

视频号创建订单接口地址: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/add_order_new.html


请求参数
{
  "create_time": "2022-10-09 18:25:28",
  "out_order_id": "SKX20221009182528461564",
  "openid": "****",
  "path": "pages/order-detail/order-detail?orderId=1570351156&orderNumber=SKX20221009182528461564",
  "fund_type": 1,
  "expire_time": 1665312928,
  "trace_id": "****",
  "aftersale_duration": 14,
  "out_user_id": null,
  "order_detail": {
    "product_infos": [
      {
        "out_product_id": "25309",
        "out_sku_id": "788096",
        "product_cnt": 1,
        "sale_price": 8900,
        "sku_real_price": 8900,
        "title": "LED灯光 L222U058",
        "head_img": "****/2022/05/05/a958c3be511949c9b4b88cac43164244",
        "path": "pages/detail/detail?spuId=25309"
      }
    ],
    "price_info": {
      "freight": 100,
      "discounted_price": 100,
      "additional_price": null,
      "additional_remarks": null,
      "order_price": 8900
    },
    "pay_info": {
      "pay_method_type": 0
    },
    "promotion_info": null
  },
  "delivery_detail": null,
  "address_info": {
    "receiver_name": "测试收货地址",
    "detailed_address": "测试收货地址",
    "tel_number": "182****4418",
    "country": null,
    "province": "辽宁省",
    "city": "沈阳市",
    "town": "和平区"
  }
}
返回信息:{"errcode":1010040,"errmsg":"订单金额计算错误 rid: 6342a199-28d520a6-396a3686","data":null}



这里我对创建订单的金额校验这里存在疑问。这笔订单我使用了包邮券。第二个校验是肯定不会通过的

两个校验,订单总金额8900 商品金额8900 运费100  折扣金额100
order_price = sum(sale_price) + freight - discounted_price + additional_price
order_price = sum(sku_real_price) + freight + additional_price

第二个订单金额校验这里。 肯定是不成立的,这个校验的意思是这里必须要有运费吗?或者默认没有运费吗?
8900(order_price)= (sum(sku_real_price))8900 + (freight)1000

大家有遇到这个问题吗?



最后一次编辑于  2022-10-09
回答关注问题邀请回答
收藏
登录 后发表内容
问题标签