Browse Source

Most recent payment method is the default payment method.

pull/149/head
Pēteris Caune 7 years ago
parent
commit
dbaae9c2b7
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      hc/payments/views.py

+ 4
- 2
hc/payments/views.py View File

@ -97,7 +97,8 @@ def create_plan(request):
if "payment_method_nonce" in request.POST:
result = braintree.PaymentMethod.create({
"customer_id": sub.customer_id,
"payment_method_nonce": request.POST["payment_method_nonce"]
"payment_method_nonce": request.POST["payment_method_nonce"],
"options": {"make_default": True}
})
if not result.is_success:
@ -153,7 +154,8 @@ def update_payment_method(request):
result = braintree.PaymentMethod.create({
"customer_id": sub.customer_id,
"payment_method_nonce": request.POST["payment_method_nonce"]
"payment_method_nonce": request.POST["payment_method_nonce"],
"options": {"make_default": True}
})
if not result.is_success:


Loading…
Cancel
Save