-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed-date-debit setting for sepa mandates #19
Conversation
First of all, thank you for the detailed proposal and settings draft. This looks really well thought-out!
I'm leaning towards yes. I'm a little bit worried about introducing a significant amount of complexity (the emailing stuff) we need to maintain for a feature that will be used only a handful of times ever. If we expect this to be something not to be used in the long run, I'd be in favor of a simpler solution (i.e. "just use a calender reminder and the sendmail plugin to send the pre-notification manually"), but I think there's potential for this beyond the current situation e.g. for events with a crowd-funding-like approach that will only be confirmed once enough people committed to buying a ticket. @pc-coholic any thoughts?
As a side node, in an event series one could want to specify the due date in relation to the event start instead of a fixed date… but I think that'd be taking it too far and the fixed date is good enough for a start ;)
Correct, there is currently no way to extend the default email settings and the correct way would be to add it in the payment provider's settings or some extra settings page.
The "required action" mechanism is unofficially deprecated (i.e. it is not used in any plugin we know of any more). We've just never deleted it to avoid breaking compatibility. We should probably officially deprecate and delete it for good. |
Thank you very much for your feedback! Now orders can be in one of three different groups:
Handling the 3rd case is a bit tricky. But I think we can ignore it. We aren't reducing the pre-notification time for the customer, possibly violating regulations, only extending the configured I will start by adding the |
Good catch! if we keep the current text "we will debit you on X or shortly after, I also think it would be fine |
This reverts commit c8392e8. Based upon the feedback provided by raphaelm in the draft PR discussion
Adds barebones earliest due date options, consisting out of a settings field and modification to the _due_date function. Adding a validation to warn organisers that their `earliest_due_date` is after the `__availability_date` might be nice. But raising a validation error prevents valid usecases where this might be needed and issuing a warning message is not possible from `settings_form_clean(self, cleaned_data)` without access to the request object
I am pondering about the export logic. After todays commits the xml export view will export all outstanding orders. The organizers bank probably won't accept this. We will need an additional export window setting to know which payment due dates should be exported.
I'm currently preffering the less disruptive new model approach. |
This model currently tracks only debit due dates but can be extended to track debit notification mails
Currently, the following parts of the payment lifecycle are implemented:
The refunds are a bit problematic because they assume that every Sepa- I would suggest reassigning payment states for all new orders: Making this change only for new orders should keep the impact as small as possible. Nevertheless, this is quite a significant behavior change. |
Yeah, probably the safer approach :(
I think we already have the logic that refunding any non-exported payment just removes it from the export instead of creating an outgoing transfer. Or did I understand you wrong?
This would be a very breaking change that I think we'll unfortunately be unable to make. We have this plugin often used in a scenario where you place an order for an event happening today (think going to a public swimming pool today), and the export might happen days later. With that change, the ticket would still be marked as unpaid and I would not get a ticket or be able to enter the event. (Yep, it's unclean that we consider it "paid" even though no money changed hands… but that's the same at export time, we'd really need to wait for the money to arrive to not have this problem). |
Sorry, I have to admit that I was confused by the refund process. Refunding an unexported payment removes it from the export. This makes my Pending/Confirmed suggestion superfluous. |
@raphaelm I think I am done with implementing the fixed-date-debit functionality. The exception beeing the organizer notification feature, which is a seperate project for a separate PR. It's my first time really diving into pretix and working with this many moving parts in one go. So, there might be some unusual solutions, which I'll address if pointed out. |
I'm not sure if this is usual, I guess this slipped through. |
I'm also not sure if it is usual, but it definitely shouldn't be. Thanks for pushing it up in the inbox again. I'll try to look at this tomorrow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, I'm again sorry it took me so long to look into this in detail.
Second, this is really good work ✨ The code has a high quality and you even added a set of tests. Very nice!
I have a few remarks inline, apart from minimal language things they mostly center about three topics:
-
E-mail placeholders: We have a system in place to handle email placeholders consistently and we should use it here. This would mean that users can use all the regular placeholders like
url
orevent
in the email texts, and that help texts etc. are auto-generated. The email system has a flexible concept of "context", allowing you to add your own placeholders in a way that they only show up for this specific email text and not for any others. To do this, you'd invent a new context piece with a unique name, such assepadebit_payment
and create new placeholders that depend on it (see docs). Then, you can just passsepadebit_payment
toget_email_context
and it will automatically resolve your placeholders. I know this all isn't perfectly documented since it hasn't been used much externally, so please just ask if you have any questions! -
Cronjob efficiency: The periodic task you added has a for loop over all events in the database (tens of thousands on pretix Hosted), and then build a long Q-query, which could lead to megabyte-long SQL queries. Even if we limit the query down just to events which use the new feature, it will still waste a lot of resources on checking events which happened five years a go. A much more efficient solution could be just saving the pre-notification time as a
DateTimeField
on theSepaDueDate
model. This way, you could just do a system-wide query and get all SepaDueDate models with unsent reminders and a reminder date in the past. -
Export logic: If I'm not mistaken, this fundamentally changes the logic in the export (see inline comment), which could be an unwanted change for everyone using this plugin already. Am I correct? Do you have any ideas on how to deal with this?
Great feedback, thank you very much. |
Co-authored-by: Raphael Michel <mail@raphaelmichel.de>
I've implemented the suggested changes and marked your reviews as resolved as I've completed them. Unfortunately including your cc to @julia-luna regarding the copy editing , which is probably still necessary. At least I am quite untalented in micro copy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting really good! I took another read and still found some stuff (sorry), but it's getting smaller and smaller ✨
Co-authored-by: Raphael Michel <mail@raphaelmichel.de>
Test case is dropped based upon the following review pretix#19 (comment)
Et voilà - all done. Back to you |
Timing wise, I was forced to install dfb729e on my pretix instance. |
I pushed a few micro-changes. I then noticed that one of your tests fails for me (even without my changes), can you reproduce that and look into it? |
It was a small indentation error I must have made after running the tests. It is fixed now. |
Finally merged, sorry for the long wait! I also pushed the strings to the translation platform: |
Great! Thank you very much for reviewing my first non-trivial contribution 😊 |
Hi,
I am currently in the situation that I have an upcoming event with ~1200 participants coming up next year around easter, for which we want to start the registration in the coming months.
I'm in the lucky situation that I am not dependent on the cash flow from the participants and would like to collect the direct debits later in the year, to avoid refunding everything if I can avoid it.
The plugin currently only supports payments executed x days after a transaction. I need all debits for an event to be executed on a common day.
I could implement a hacky exporter for myself, but I think this might be a useful feature for the upstream plugin.
Draft:
I have implemented a first mockup of the settings screen to discuss the functionality:
Settings:
Relative date (default):
The same behavior as before. The user has to export the XML files regularly.
Fixed date:
Direct debits are due on a specified date for all sales.
There are now three different settings:
Number 2 and 3 could be moved to the email settings (see Open point emails). But I think they are important enough to be a part of the payment settings and warrant timeline entries.
Fixed date payments are excluded from the event and organizer XML exports until after the export notification date.
Open Point: Emails
I think the texts of these two emails should be configurable, preferably in the emails section of the events settings.
If I am not mistaken, it is currently not possible to inject new e-mail-templates as a plugin, given that this is a fixed list of templates. It might be cool to add a hook for plugins to supply email templates.
Otherwise, I could add these settings directly into the payment provider's settings.
Next steps:
I'd like to start implementing this in the next month or so.
Therefore my questions are:
pretix-sepadebit
?