-
Notifications
You must be signed in to change notification settings - Fork 209
PayPalSignals
There are problems with the current set of signals in django-paypal:
- Missing signals for important events
- Misleading signals. For example, 'payment_was_successful' fires even when 'payment_status=Failed', which is pretty confusing.
I want to address these in future versions. I would like to remove 'payment_was_successful' altogether (since it is misleading and the name is too vague.), and replace with 'payment_was_confirmed', and either: signals for every payment_status, or, more likely, a more general signals like 'payment_notification' which covers everything else.
We need a deprecation path so that if 'payment_was_successful' has any subscribers, a warning will be issued.
Another requirement is that if future versions add additional signals, the behaviour won't keep changing for people using the code. For example, if we add a 'payment_was_denied' signal which is mutually exclusive to 'payment_was_successful', then any code that subscribed to 'payment_was_successful' and checked the 'payment_status' will stop working when they upgrade. Instead, we want to do something like 'payment_notification' (which fires on all valid IPNs), and, on top of that, 'payment_was_confirmed', 'payment_was_denied' etc. which checks specific values of 'payment_status'.
It might be a good idea to have a strong convention regarding signal names to make it clear which are the 'parent' signals. e.g. 'payment_notification' and 'payment_notification_confirmed' would indicate that the second is a subset of the first. This will result in longer and possibly more awkward names, but would increase clarity.
Please edit this page with more ideas.
See comments here:
https://github.com/spookylukey/django-paypal/pull/3#issuecomment-32271483
See also: