Commit 36505db5 authored by PCoder's avatar PCoder

set default_payment_method

parent e7462289
......@@ -980,6 +980,7 @@ class OrderConfirmationView(DetailView, FormView):
discount['stripe_coupon_id']
else ""),
tax_rates=[stripe_tax_rate.tax_rate_id] if stripe_tax_rate else [],
default_payment_method=request.session['id_payment_method']
)
stripe_subscription_obj = subscription_result.get('response_object')
logger.debug(stripe_subscription_obj)
......
......@@ -1201,6 +1201,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView, FormView):
discount['stripe_coupon_id']
else ""),
tax_rates=[stripe_tax_rate.tax_rate_id] if stripe_tax_rate else [],
default_payment_method=request.session['id_payment_method']
)
stripe_subscription_obj = subscription_result.get('response_object')
latest_invoice = stripe.Invoice.retrieve(stripe_subscription_obj.latest_invoice)
......
......@@ -329,10 +329,12 @@ class StripeUtils(object):
@handleStripeError
def subscribe_customer_to_plan(self, customer, plans, trial_end=None,
coupon="", tax_rates=list()):
coupon="", tax_rates=list(),
default_payment_method=""):
"""
Subscribes the given customer to the list of given plans
:param default_payment_method:
:param tax_rates:
:param coupon:
:param customer: The stripe customer identifier
......@@ -355,7 +357,8 @@ class StripeUtils(object):
customer=customer, items=plans, trial_end=trial_end,
coupon=coupon,
default_tax_rates=tax_rates,
payment_behavior='allow_incomplete'
payment_behavior='allow_incomplete',
default_payment_method=default_payment_method
)
logger.debug("Done subscribing")
return subscription_result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment