|
|
|
|
@ -184,6 +184,8 @@ class PaymentwallCallbackView(View): |
|
|
|
|
payment.date_end = date_end |
|
|
|
|
if product_type_name == 'course': |
|
|
|
|
properties = { |
|
|
|
|
'payment_id': payment.id, |
|
|
|
|
'amount': payment.amount, |
|
|
|
|
'status': payment.status, |
|
|
|
|
'course': payment.course.id, |
|
|
|
|
'created_at': payment.created_at, |
|
|
|
|
@ -191,6 +193,8 @@ class PaymentwallCallbackView(View): |
|
|
|
|
} |
|
|
|
|
elif product_type_name == 'school': |
|
|
|
|
properties = { |
|
|
|
|
'payment_id': payment.id, |
|
|
|
|
'amount': payment.amount, |
|
|
|
|
'status': payment.status, |
|
|
|
|
'weekdays': payment.weekdays, |
|
|
|
|
'date_start': payment.date_start, |
|
|
|
|
@ -198,13 +202,13 @@ class PaymentwallCallbackView(View): |
|
|
|
|
'created_at': payment.created_at, |
|
|
|
|
'update_at': payment.update_at, |
|
|
|
|
} |
|
|
|
|
payment.save() |
|
|
|
|
product_payment_to_mixpanel.delay( |
|
|
|
|
payment.user.id, |
|
|
|
|
f'{product_type_name.title()} payment', |
|
|
|
|
now().strftime('%Y-%m-%dT%H:%M:%S'), |
|
|
|
|
properties=properties, |
|
|
|
|
) |
|
|
|
|
payment.save() |
|
|
|
|
|
|
|
|
|
author_balance = getattr(payment, 'author_balance', None) |
|
|
|
|
if author_balance and author_balance.type == AuthorBalance.IN: |
|
|
|
|
|