post request attributes changed
This commit is contained in:
parent
0263964705
commit
315ce92a78
1 changed files with 3 additions and 4 deletions
|
@ -747,13 +747,12 @@ class OrdersHostingDetailView(LoginRequiredMixin,
|
||||||
template = request.session.get('template')
|
template = request.session.get('template')
|
||||||
specs = request.session.get('specs')
|
specs = request.session.get('specs')
|
||||||
stripe_customer_id = request.session.get('customer')
|
stripe_customer_id = request.session.get('customer')
|
||||||
customer = StripeCustomer.objects.filter(id=stripe_customer_id).first()
|
|
||||||
billing_address_data = request.session.get('billing_address_data')
|
billing_address_data = request.session.get('billing_address_data')
|
||||||
vm_template_id = template.get('id', 1)
|
vm_template_id = template.get('id', 1)
|
||||||
|
stripe_api_cus_id = self.request.session.get('customer')
|
||||||
# Make stripe charge to a customer
|
# Make stripe charge to a customer
|
||||||
stripe_utils = StripeUtils()
|
stripe_utils = StripeUtils()
|
||||||
card_details = stripe_utils.get_card_details(customer.stripe_id,
|
card_details = stripe_utils.get_card_details(stripe_api_cus_id,
|
||||||
request.session.get(
|
request.session.get(
|
||||||
'token'))
|
'token'))
|
||||||
if not card_details.get('response_object'):
|
if not card_details.get('response_object'):
|
||||||
|
@ -780,7 +779,7 @@ class OrdersHostingDetailView(LoginRequiredMixin,
|
||||||
name=plan_name,
|
name=plan_name,
|
||||||
stripe_plan_id=stripe_plan_id)
|
stripe_plan_id=stripe_plan_id)
|
||||||
subscription_result = stripe_utils.subscribe_customer_to_plan(
|
subscription_result = stripe_utils.subscribe_customer_to_plan(
|
||||||
customer.stripe_id,
|
stripe_api_cus_id,
|
||||||
[{"plan": stripe_plan.get(
|
[{"plan": stripe_plan.get(
|
||||||
'response_object').stripe_plan_id}])
|
'response_object').stripe_plan_id}])
|
||||||
stripe_subscription_obj = subscription_result.get('response_object')
|
stripe_subscription_obj = subscription_result.get('response_object')
|
||||||
|
|
Loading…
Reference in a new issue