Skip to content

Commit

Permalink
[BE] add support for updating CC information
Browse files Browse the repository at this point in the history
  • Loading branch information
poxip committed May 30, 2018
1 parent 4b7eb45 commit b395a3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions aa_stripe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def create_at_stripe(self):
)
self.stripe_customer_id = customer["id"]
self.stripe_response = customer
self.sources = customer.sources.data
self.is_created_at_stripe = True
self.save()
return self
Expand Down
5 changes: 3 additions & 2 deletions tests/test_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ def test_user_create(self):
"sources": {
"object": "list",
"data": [

{"id": "card_xyz", "object": "card"}
],
"has_more": False,
"total_count": 0,
"total_count": 1,
"url": "/v1/customers/cus_9Oop0gQ1R1ATMi/sources"
},
"subscriptions": {
Expand Down Expand Up @@ -127,6 +127,7 @@ def test_user_create(self):
self.assertEqual(customer.stripe_js_response, self.stripe_js_response)
self.assertEqual(customer.stripe_customer_id, "cus_9Oop0gQ1R1ATMi")
self.assertEqual(customer.stripe_response["id"], "cus_9Oop0gQ1R1ATMi")
self.assertEqual(customer.sources, [{"id": "card_xyz", "object": "card"}])

def test_change_description(self):
customer_id = self.stripe_js_response["id"]
Expand Down

0 comments on commit b395a3c

Please sign in to comment.