From 313ba9d50200f40689b9dda5c29ba39240ef68b4 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Fri, 29 Sep 2017 08:42:17 +0200 Subject: [PATCH] Refactor set_subscription_id - use stripe subscription id instead of obj --- hosting/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hosting/models.py b/hosting/models.py index 73c082bb..49932f69 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -88,19 +88,19 @@ class HostingOrder(AssignPermissionsMixin, models.Model): self.cc_brand = stripe_charge.source.brand self.save() - def set_subscription_id(self, subscription_object, cc_details): + def set_subscription_id(self, subscription_id, cc_details): """ When creating a Stripe subscription, we have subscription id. We store this in the subscription_id field. - This method sets the subscription id from subscription_object - and also the last4 and credit card brands used for this order. + This method sets the subscription id + and the last4 and credit card brands used for this order. - :param subscription_object: Stripe's subscription object + :param subscription_id: Stripe's subscription id :param cc_details: A dict containing card details {last4, brand} :return: """ - self.subscription_id = subscription_object.id + self.subscription_id = subscription_id self.last4 = cc_details.get('last4') self.cc_brand = cc_details.get('brand') self.save()