解决报名支付
All checks were successful
Deploy to Server / deploy (push) Successful in 36s

This commit is contained in:
jeremygan2021
2026-02-23 16:20:34 +08:00
parent 6bbbb49d90
commit 58176c6651
10 changed files with 70 additions and 19 deletions

View File

@@ -93,6 +93,11 @@ class ActivityViewSet(viewsets.ReadOnlyModelViewSet):
contact_phone = signup_info.get('phone') or user.phone_number or ''
if contact_name: order.customer_name = contact_name
if contact_phone: order.phone_number = contact_phone
# Ensure activity is linked
if not order.activity:
order.activity = activity
order.save()
if not order:
@@ -105,6 +110,9 @@ class ActivityViewSet(viewsets.ReadOnlyModelViewSet):
if pending_order:
order = pending_order
# Ensure shipping address is up-to-date
order.shipping_address = activity.location or '线下活动'
order.save()
else:
contact_name = signup_info.get('name') or signup_info.get('participant_name') or user.nickname or 'Activity User'
contact_phone = signup_info.get('phone') or user.phone_number or ''
@@ -136,7 +144,8 @@ class ActivityViewSet(viewsets.ReadOnlyModelViewSet):
'total': int(activity.price * 100),
'currency': 'CNY'
},
notify_url=wxpay._notify_url
notify_url=wxpay._notify_url,
attach=f'{{"type":"activity","activity_id":{activity.id}}}'
)
import json