|
|
|
|
@ -22,7 +22,7 @@ from paymentwall import Pingback, Product, Widget |
|
|
|
|
|
|
|
|
|
from apps.course.models import Course |
|
|
|
|
from apps.school.models import SchoolSchedule |
|
|
|
|
from apps.payment.tasks import transaction_to_mixpanel, product_payment_to_mixpanel |
|
|
|
|
from apps.payment.tasks import transaction_to_mixpanel, product_payment_to_mixpanel, transaction_to_roistat |
|
|
|
|
|
|
|
|
|
from .models import AuthorBalance, CoursePayment, SchoolPayment |
|
|
|
|
|
|
|
|
|
@ -251,6 +251,15 @@ class PaymentwallCallbackView(View): |
|
|
|
|
properties, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
transaction_to_roistat.delay( |
|
|
|
|
payment.user.id, |
|
|
|
|
payment.id, |
|
|
|
|
f'{product_type_name.title()} payment', |
|
|
|
|
payment.amount, |
|
|
|
|
now().strftime('%Y-%m-%dT%H:%M:%S'), |
|
|
|
|
pingback.get_type(), |
|
|
|
|
product_type_name, |
|
|
|
|
) |
|
|
|
|
author_balance = getattr(payment, 'author_balance', None) |
|
|
|
|
if author_balance and author_balance.type == AuthorBalance.IN: |
|
|
|
|
if pingback.is_deliverable(): |
|
|
|
|
|