Refactor frontend components and backend migrations
- Removed TradingGraph component from frontend/src/components/trading. - Updated home page to import Services component and TradingGraph from new path. - Modified PortfolioPage to return null instead of PortfolioGrid. - Added initial migrations for account, advertisement, commerce, configuration, downloader, gopay, stripe, trading212, and zasilkovna apps in the backend. - Created Services component with subcomponents for Kinematografie, Drone Service, and Website Service. - Implemented TradingGraph component with dynamic data generation and canvas rendering. - Updated DonationShop component to display donation tiers with icons and descriptions.
This commit is contained in:
8
backend/thirdparty/stripe/views.py
vendored
8
backend/thirdparty/stripe/views.py
vendored
@@ -9,7 +9,7 @@ from drf_spectacular.utils import extend_schema
|
||||
import os
|
||||
import logging
|
||||
|
||||
from .models import StripeTransaction
|
||||
from .models import StripeModel
|
||||
from commerce.models import Order, Payment
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -48,7 +48,7 @@ class StripeWebhook(APIView):
|
||||
# ZAPLACENO
|
||||
if event['type'] == 'checkout.session.completed':
|
||||
|
||||
stripe_transaction = StripeTransaction.objects.get(stripe_session_id=session.id)
|
||||
stripe_transaction = StripeModel.objects.get(stripe_session_id=session.id)
|
||||
|
||||
if stripe_transaction:
|
||||
stripe_transaction.paid()
|
||||
@@ -60,7 +60,7 @@ class StripeWebhook(APIView):
|
||||
|
||||
# EXPIRACE (zrušení objednávky) uživatel nezaplatil do 24 hodin!
|
||||
elif event['type'] == 'checkout.session.expired':
|
||||
order = Order.objects.get(payment=Payment.objects.get(stripe=StripeTransaction.objects.get(stripe_session_id=session.id)))
|
||||
order = Order.objects.get(payment=Payment.objects.get(stripe=StripeModel.objects.get(stripe_session_id=session.id)))
|
||||
order.status = Order.STATUS_CHOICES.CANCELLED
|
||||
order.save()
|
||||
|
||||
@@ -71,7 +71,7 @@ class StripeWebhook(APIView):
|
||||
# REFUND POTVRZEN
|
||||
elif event['type'] == 'payment_intent.refunded':
|
||||
session = event['data']['object']
|
||||
stripe_transaction = StripeTransaction.objects.get(stripe_payment_intent=session.id)
|
||||
stripe_transaction = StripeModel.objects.get(stripe_payment_intent=session.id)
|
||||
|
||||
if stripe_transaction:
|
||||
stripe_transaction.refund_confirmed()
|
||||
|
||||
Reference in New Issue
Block a user