stripe_id used instead of id

This commit is contained in:
Arvind Tiwari 2017-10-03 21:04:25 +05:30
parent 65745b5098
commit 0263964705

View file

@ -638,7 +638,7 @@ class PaymentVMView(LoginRequiredMixin, FormView):
request.session['billing_address_data'] = billing_address_data
request.session['token'] = token
request.session['customer'] = customer.id
request.session['customer'] = customer.stripe_id
return HttpResponseRedirect("{url}?{query_params}".format(
url=reverse('hosting:order-confirmation'),
query_params='page=payment'))
@ -663,16 +663,12 @@ class OrdersHostingDetailView(LoginRequiredMixin,
context = super(DetailView, self).get_context_data(**kwargs)
obj = self.get_object()
owner = self.request.user
stripe_customer_id = self.request.session.get('customer')
customer = StripeCustomer.objects.filter(id=stripe_customer_id).first()
stripe_api_cus_id = self.request.session.get('customer')
stripe_utils = StripeUtils()
if customer:
card_details = stripe_utils.get_card_details(
customer.stripe_id,
self.request.session.get('token')
)
else:
card_details = {}
card_details = stripe_utils.get_card_details(
stripe_api_cus_id,
self.request.session.get('token')
)
if self.request.GET.get('page') == 'payment':
context['page_header_text'] = _('Confirm Order')