Skip to content

Commit 97ba417

Browse files
committed
fixes of WhyNotHugo's remarks
1 parent c8a78d1 commit 97ba417

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

payments/core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,14 @@ def get_return_url(
146146
def autocomplete_with_subscription(self, payment):
147147
"""
148148
Complete the payment with subscription
149-
Used by providers, that use server initiated subscription workflow
150149
151-
Throws RedirectNeeded if there is problem with the payment that needs to be solved by user
150+
If the provider uses workflow such that the payments are initiated from
151+
implementer's side.
152+
The users of django-payments will create a payment and call
153+
Payment.autocomplete_with_subscription() right before the subscription end.
154+
155+
Throws RedirectNeeded if there is problem with the payment
156+
that needs to be solved by user.
152157
"""
153158
raise NotImplementedError()
154159

payments/models.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ class TimeUnit(enum.Enum):
6565
month = "month"
6666
day = "day"
6767

68-
def get_token(self) -> str:
69-
return self.token
70-
7168
def set_recurrence(self, token: str, **kwargs):
7269
"""
7370
Sets token and other values associated with subscription recurrence
@@ -262,9 +259,14 @@ def is_recurring(self) -> bool:
262259
def autocomplete_with_subscription(self):
263260
"""
264261
Complete the payment with subscription
265-
Used by providers, that use server initiated subscription workflow
266262
267-
Throws RedirectNeeded if there is problem with the payment that needs to be solved by user
263+
If the provider uses workflow such that the payments are initiated from
264+
implementer's side.
265+
Call this function right before the subscription end to
266+
make a new subscription payment.
267+
268+
Throws RedirectNeeded if there is problem with the payment
269+
that needs to be solved by user
268270
"""
269271
provider = provider_factory(self.variant)
270272
provider.autocomplete_with_subscription(self)

0 commit comments

Comments
 (0)