fix: 创建订单兼容 H5 的 zhiding_id 指定字段
This commit is contained in:
@@ -794,7 +794,13 @@ class CreateOrderView(APIView):
|
||||
shangpin_id = request.data.get('shangpin_id')
|
||||
nicheng = request.data.get('nicheng', '').strip()
|
||||
beizhu = request.data.get('Remark', '').strip()
|
||||
zhiding = request.data.get('zhiding', '').strip()
|
||||
# H5 曾误传 zhiding_id,兼容两种字段名
|
||||
zhiding = (
|
||||
request.data.get('zhiding')
|
||||
or request.data.get('zhiding_id')
|
||||
or ''
|
||||
)
|
||||
zhiding = str(zhiding).strip()
|
||||
jine = request.data.get('jine', 0)
|
||||
pay_method = request.data.get('pay_method', 'wechat').strip().lower()
|
||||
|
||||
@@ -1157,8 +1163,9 @@ class CreateOrderView(APIView):
|
||||
pay_sign_string += f'&key={KEY}'
|
||||
pay_sign = hashlib.md5(pay_sign_string.encode('utf-8')).hexdigest().upper()
|
||||
|
||||
# 返回支付参数(格式与前端完全匹配)
|
||||
# 返回支付参数(H5 JSAPI 必须带 appId;小程序可忽略)
|
||||
result = {
|
||||
'appId': APPID,
|
||||
'timeStamp': timestamp,
|
||||
'nonceStr': nonce_str,
|
||||
'package': package,
|
||||
|
||||
Reference in New Issue
Block a user