更新ios
This commit is contained in:
13
app.py
13
app.py
@@ -3873,22 +3873,19 @@ def create_wechat_jsapi_order():
|
||||
'should_free_upgrade': True
|
||||
}), 400
|
||||
|
||||
# 生成订单号
|
||||
order_no = f"WXH5{int(time.time())}{user_id}{uuid.uuid4().hex[:6].upper()}"
|
||||
|
||||
# 创建订单记录
|
||||
# 创建订单记录(PaymentOrder.__init__ 会自动生成 order_no)
|
||||
order = PaymentOrder(
|
||||
user_id=user_id,
|
||||
order_no=order_no,
|
||||
plan_name=plan_name,
|
||||
billing_cycle=billing_cycle,
|
||||
amount=amount,
|
||||
original_amount=price_result.get('original_price', amount),
|
||||
discount_amount=price_result.get('discount_amount', 0),
|
||||
status='pending',
|
||||
payment_method='wechat_jsapi',
|
||||
payment_source='h5'
|
||||
)
|
||||
# 设置其他属性
|
||||
order.payment_method = 'wechat_jsapi'
|
||||
order.payment_source = 'h5'
|
||||
order_no = order.order_no # 使用自动生成的订单号
|
||||
|
||||
# 关联优惠码
|
||||
if promo_code and price_result.get('promo_applied'):
|
||||
|
||||
Reference in New Issue
Block a user