Compare commits
No commits in common. "0bd77cf1b6497b5d4d95196390bde6d34be74c4a" and "953157ea15c7ccd3b7db1a798704e3ede11dd704" have entirely different histories.
0bd77cf1b6
...
953157ea15
@ -9368,7 +9368,6 @@ def payment_callback(request, dealer_slug):
|
|||||||
history = models.PaymentHistory.objects.filter(transaction_id=payment_id).first()
|
history = models.PaymentHistory.objects.filter(transaction_id=payment_id).first()
|
||||||
payment_status = request.GET.get("status")
|
payment_status = request.GET.get("status")
|
||||||
order = Order.objects.filter(user=dealer.user, status=1).first() # Status 1 = NEW
|
order = Order.objects.filter(user=dealer.user, status=1).first() # Status 1 = NEW
|
||||||
print(order)
|
|
||||||
if payment_status == "paid":
|
if payment_status == "paid":
|
||||||
billing_info, created = BillingInfo.objects.get_or_create(
|
billing_info, created = BillingInfo.objects.get_or_create(
|
||||||
user=dealer.user,
|
user=dealer.user,
|
||||||
@ -9381,27 +9380,19 @@ def payment_callback(request, dealer_slug):
|
|||||||
'country': dealer.entity.country or " ",
|
'country': dealer.entity.country or " ",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if not hasattr(order.user, 'userplan'):
|
|
||||||
UserPlan.objects.create(
|
|
||||||
user=order.user,
|
|
||||||
plan=order.plan,
|
|
||||||
expire=datetime.now().date() + timedelta(days=order.get_plan_pricing().pricing.period)
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
# if order.user.userplan:
|
|
||||||
# user = order.user
|
|
||||||
# pricing = order.get_plan_pricing().pricing
|
|
||||||
|
|
||||||
# logger.info(f"Processing order completion for {user} - upgrading to {order.plan}")
|
|
||||||
# user.userplan.plan = order.plan
|
|
||||||
# user.userplan.expire = datetime.now() + timedelta(days=pricing.period)
|
|
||||||
# user.userplan.save()
|
|
||||||
# user.save()
|
|
||||||
# logger.info(f"User {user} upgraded to {order.plan} plan successfully")
|
|
||||||
|
|
||||||
order.complete_order()
|
order.complete_order()
|
||||||
|
user = order.user
|
||||||
|
pricing = order.get_plan_pricing().pricing
|
||||||
|
|
||||||
|
logger.info(f"Processing order completion for {user} - upgrading to {order.plan}")
|
||||||
|
user.userplan.plan = order.plan
|
||||||
|
user.userplan.expire = datetime.now() + timedelta(days=pricing.period)
|
||||||
|
user.userplan.save()
|
||||||
|
user.save()
|
||||||
|
logger.info(f"User {user} upgraded to {order.plan} plan successfully")
|
||||||
|
|
||||||
history.status = "paid"
|
history.status = "paid"
|
||||||
history.save()
|
history.save()
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 573 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 506 KiB |
|
Before Width: | Height: | Size: 522 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 23 KiB |
@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% url "estimate_create" request.dealer.slug as create_estimate_url %}
|
{% url "estimate_create" request.dealer.slug as create_estimate_url %}
|
||||||
{% include "empty-illustration-page.html" with value="estimate" url=create_estimate_url %}
|
{% include "empty-illustration-page.html" with value="estimate" url=create_estimate_url image='images/no_content/no_estimate.jpg' %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -83,8 +83,8 @@
|
|||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if request.user.userplan %}
|
{% if request.user.userplan %}
|
||||||
{% url "user_create" request.dealer.slug as create_staff_url %}
|
{% url "user_create" request.dealer.slug as create_staff_url image="images/no_content/no_user.png" %}
|
||||||
{% include "empty-illustration-page.html" with value="staff" url=create_staff_url image="images/no_content/no_user.png"%}
|
{% include "empty-illustration-page.html" with value="staff" url=create_staff_url %}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% url "pricing_page" request.dealer.slug as pricing_page_url %}
|
{% url "pricing_page" request.dealer.slug as pricing_page_url %}
|
||||||
|
|||||||