diff --git a/payments/core.py b/payments/core.py index b61343f3b..8848fd3bf 100644 --- a/payments/core.py +++ b/payments/core.py @@ -122,9 +122,14 @@ def get_return_url(self, payment, extra_data=None): def autocomplete_with_subscription(self, payment): """ Complete the payment with subscription - Used by providers, that use server initiated subscription workflow - Throws RedirectNeeded if there is problem with the payment that needs to be solved by user + If the provider uses workflow such that the payments are initiated from + implementer's side. + The users of django-payments will create a payment and call + Payment.autocomplete_with_subscription() right before the subscription end. + + Throws RedirectNeeded if there is problem with the payment + that needs to be solved by user. """ raise NotImplementedError() diff --git a/payments/models.py b/payments/models.py index 3330ff2f8..3b32846fe 100644 --- a/payments/models.py +++ b/payments/models.py @@ -61,9 +61,6 @@ class TimeUnit(enum.Enum): month = "month" day = "day" - def get_token(self) -> str: - return self.token - def set_recurrence(self, token: str, **kwargs): """ Sets token and other values associated with subscription recurrence @@ -220,9 +217,14 @@ def is_recurring(self) -> bool: def autocomplete_with_subscription(self): """ Complete the payment with subscription - Used by providers, that use server initiated subscription workflow - Throws RedirectNeeded if there is problem with the payment that needs to be solved by user + If the provider uses workflow such that the payments are initiated from + implementer's side. + Call this function right before the subscription end to + make a new subscription payment. + + Throws RedirectNeeded if there is problem with the payment + that needs to be solved by user """ provider = provider_factory(self.variant) provider.autocomplete_with_subscription(self)