forked from uncloud/uncloud
cleanup/in between commit
This commit is contained in:
parent
f7c68b5ca5
commit
e51edab2f5
11 changed files with 107 additions and 99 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue