响应:{'err_code': 40012, 'err_msg': 'open_id错误, 请确认是否是在抖音/抖音lite/火山 app内生成', 'body': ''}
def push_out_order(self, order: Order, appid):
url = "https://developer.toutiao.com/api/apps/order/v2/push"
order_detail = {
"order_id": order.out_order_no,
"create_time": int(order.created_at.timestamp() * 1000),
"status": "待支付" if order.status == 0 else "已支付",
"amount": 1,
"total_price": order.total_amount,
"detail_url": "",
"item_list": [
{
"item_code": "lock",
"img": "",
"title": "查看结果",
"sub_title": "",
"amount": 1,
"price": order.total_amount
}
]
}
payload = json.dumps({
"access_token": self.get_access_token(platform.build_env_info(appid)),
"app_name": "douyin",
"open_id": order.user_id,
"order_type": 0,
"update_time": int(order.updated_at.timestamp() * 1000),
"order_detail": json.dumps(order_detail, ensure_ascii=False)
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
logging.info(f'order:{order},openid:{appid},response:{response.json()}')
return response.json()请问是哪里有问题
