From 9d21181073748d60b1f85759ce44e03a07324215 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Feb 2020 12:23:47 +0530 Subject: [PATCH] Get stripe invoice obj correctly --- hosting/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 1f30ba11..09e1131a 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1693,9 +1693,10 @@ class VirtualMachineView(LoginRequiredMixin, View): inv_url = None if hosting_order.subscription_id: stripe_obj = stripe.Invoice.list( - subscription=hosting_order.subscription_id + subscription=hosting_order.subscription_id, + count=0 ) - inv_url = stripe_obj[0].data.hosted_invoice_url + inv_url = stripe_obj.data[0].hosted_invoice_url elif hosting_order.stripe_charge_id: stripe_obj = stripe.Charge.retrieve( hosting_order.stripe_charge_id