From 8d7b01d7e273ac48a9aaa1ea9ba2b85ed084a6f4 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 5 Jul 2018 09:57:47 +0200 Subject: [PATCH] Disable dissociating card on subscription failure --- datacenterlight/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index cd69c3ad..b93df4d8 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -530,6 +530,13 @@ class OrderConfirmationView(DetailView): # Check if the subscription was approved and is active if (stripe_subscription_obj is None or stripe_subscription_obj.status != 'active'): + # At this point, we have created a Stripe API card and + # associated it with the customer; but the transaction failed + # due to some reason. + # stripe_utils.dissociate_customer_card( + # stripe_api_cus_id, + # card_details_dict['card_id'] + # ) msg = subscription_result.get('error') messages.add_message(self.request, messages.ERROR, msg, extra_tags='failed_payment')