We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cd8827 commit 6041313Copy full SHA for 6041313
fundraising/views.py
@@ -159,8 +159,9 @@ def update_card(request):
159
customer = stripe.Customer.retrieve(
160
donation.stripe_customer_id, expand=["subscriptions"]
161
)
162
+ token = stripe.Token.retrieve(request.POST["stripe_token"])
163
subscription = customer.subscriptions.retrieve(donation.stripe_subscription_id)
- subscription.default_source = request.POST["stripe_token"]
164
+ subscription.default_source = token.card.id
165
subscription.save()
166
except stripe.error.StripeError as e:
167
data = {"success": False, "error": str(e)}
0 commit comments