Skip to content

Commit

Permalink
Add endpoint to return list of Product objects in paymnet app
Browse files Browse the repository at this point in the history
  • Loading branch information
DEENUU1 committed Dec 9, 2023
1 parent cfab880 commit d212a7e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions payment/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.generics import ListAPIView
from rest_framework import status
import stripe
from django.conf import settings
Expand All @@ -11,10 +12,21 @@
import json
from django.http import HttpResponse
from company.models import Company
from .serializers import ProductSerializer

stripe.api_key = settings.STRIPE_SECRET_KEY


class ProductListView(ListAPIView):
queryset = Product.objects.all()
serializer_class = ProductSerializer
permission_classes = [IsAuthenticated]

def get_queryset(self):
queryset = super().get_queryset()
return queryset


class StripeCheckoutSessionView(APIView):
permission_classes = [IsAuthenticated]

Expand Down

0 comments on commit d212a7e

Please sign in to comment.