Skip to content

Commit f3d265a

Browse files
committed
fixes of WhyNotHugo's remarks
1 parent 307bd40 commit f3d265a

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
@@ -122,9 +122,14 @@ def get_return_url(self, payment, extra_data=None):
122122
def autocomplete_with_subscription(self, payment):
123123
"""
124124
Complete the payment with subscription
125-
Used by providers, that use server initiated subscription workflow
126125
127-
Throws RedirectNeeded if there is problem with the payment that needs to be solved by user
126+
If the provider uses workflow such that the payments are initiated from
127+
implementer's side.
128+
The users of django-payments will create a payment and call
129+
Payment.autocomplete_with_subscription() right before the subscription end.
130+
131+
Throws RedirectNeeded if there is problem with the payment
132+
that needs to be solved by user.
128133
"""
129134
raise NotImplementedError()
130135

payments/models.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ class TimeUnit(enum.Enum):
6161
month = "month"
6262
day = "day"
6363

64-
def get_token(self) -> str:
65-
return self.token
66-
6764
def set_recurrence(self, token: str, **kwargs):
6865
"""
6966
Sets token and other values associated with subscription recurrence
@@ -220,9 +217,14 @@ def is_recurring(self) -> bool:
220217
def autocomplete_with_subscription(self):
221218
"""
222219
Complete the payment with subscription
223-
Used by providers, that use server initiated subscription workflow
224220
225-
Throws RedirectNeeded if there is problem with the payment that needs to be solved by user
221+
If the provider uses workflow such that the payments are initiated from
222+
implementer's side.
223+
Call this function right before the subscription end to
224+
make a new subscription payment.
225+
226+
Throws RedirectNeeded if there is problem with the payment
227+
that needs to be solved by user
226228
"""
227229
provider = provider_factory(self.variant)
228230
provider.autocomplete_with_subscription(self)

0 commit comments

Comments
 (0)