Conversation
Codecov Report
@@ Coverage Diff @@
## master #274 +/- ##
==========================================
- Coverage 79.92% 78.58% -1.34%
==========================================
Files 28 28
Lines 1783 1868 +85
Branches 212 223 +11
==========================================
+ Hits 1425 1468 +43
- Misses 251 283 +32
- Partials 107 117 +10
Continue to review full report at Codecov.
|
for more information, see https://pre-commit.ci
|
Now I was at least able to override the plan price. |
|
I have re-implemented this in django-plans-paypal which uses subscription button from |
WhyNotHugo
left a comment
There was a problem hiding this comment.
Sorry for the slowness in feedback here; every time I looked at this PR I couldn't quite figure out a few details... I've questions about it below:
| self._payment.extra_data = json.dumps(data) | ||
|
|
||
|
|
||
| class BaseSubscription(models.Model): |
There was a problem hiding this comment.
If I understand correctly, applications need to provide a subclass of this model, correct?
Can you add a brief docstring mentioning this?
| 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 | ||
| """ | ||
| raise NotImplementedError() |
There was a problem hiding this comment.
I don't understand what this method should do.
What does autocomplete mean in this context?
| def get_period(self) -> int: | ||
| raise NotImplementedError() |
There was a problem hiding this comment.
I'm not sure what this is supposed to return either.
| class TimeUnit(enum.Enum): | ||
| year = "year" | ||
| month = "month" | ||
| day = "day" |
There was a problem hiding this comment.
Perhaps you're looking for https://github.com/jazzband/django-recurrence/?
This is partially working implementation of PayPal subscriptions. I was able to manage subscription creation, getting state and cancelling. This is based subscription support drafted in #217.
Although I was able to successfully manage communication with PayPal, I have got stuck and I don't know how to continue at this point. The main problems are:
PayPal requires setting
plan_idand having Plan created at the time of creating the Subscription.This is not required when using Subscription button (like
django-paypaldoes). It brings in whole lot of problems - the price can't be changed per user, it requires implementer to set up the Plans on PayPal and maintain consistency with server settings (especially ifdjango-paymentsare used with multiple providers).Getting notification of the payments
I don't know how to capture the recurring payments. With PayPal Subscription buttons PayPal sends notification about the payment. I didn't find how to do that with API. There also might be possibility to check the Subscriptions through the API and check their (possibly changed) expiration.