cleanup/in between commit

This commit is contained in:
Nico Schottelius 2020-12-26 11:22:51 +01:00
commit e51edab2f5
11 changed files with 107 additions and 99 deletions

View file

@ -65,6 +65,36 @@ class RegisterCard(LoginRequiredMixin, TemplateView):
context['stripe_pk'] = uncloud_stripe.public_api_key
return context
class ListCards(LoginRequiredMixin, TemplateView):
login_url = '/login/'
template_name = "uncloud_pay/list_stripe.html"
def get_context_data(self, **kwargs):
customer_id = uncloud_stripe.get_customer_id_for(self.request.user)
cards = uncloud_stripe.get_customer_cards(customer_id)
context = super().get_context_data(**kwargs)
context['cards'] = cards
context['username'] = self.request.user
return context
class DeleteCard(LoginRequiredMixin, TemplateView):
login_url = '/login/'
template_name = "uncloud_pay/delete_stripe_card.html"
def get_context_data(self, **kwargs):
customer_id = uncloud_stripe.get_customer_id_for(self.request.user)
cards = uncloud_stripe.get_customer_cards(customer_id)
context = super().get_context_data(**kwargs)
context['cards'] = cards
context['username'] = self.request.user
return context
class PaymentMethodViewSet(viewsets.ModelViewSet):
permission_classes = [permissions.IsAuthenticated]