forked from dj-stripe/dj-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DjstripePaymentMethod._get_or_create_from_stripe_object to allo…
…w syncing of PaymentMethodForeignkeys DjstripePaymentMethod._get_or_create_from_stripe_object is essentially a wrapper around the already implemented DjstripePaymentMethod._get_or_create_source and also added the Subscription Source type to the list of known sources Updated Corresponding Tests
- Loading branch information
1 parent
767b4b8
commit 663b95c
Showing
6 changed files
with
125 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,13 @@ def setUp(self): | |
user = get_user_model().objects.create_user( | ||
username="testuser", email="[email protected]" | ||
) | ||
|
||
# create a source object so that FAKE_CUSTOMER_III with a default source | ||
# can be created correctly. | ||
fake_source_data = deepcopy(FAKE_SOURCE) | ||
fake_source_data["customer"] = None | ||
self.source = Source.sync_from_stripe_data(fake_source_data) | ||
|
||
self.customer = FAKE_CUSTOMER_III.create_for_user(user) | ||
self.customer.sources.all().delete() | ||
self.customer.legacy_cards.all().delete() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters