Skip to content
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

[Feature] Automagic Invoices #197

Open
JustSamuel opened this issue Jul 3, 2024 · 4 comments
Open

[Feature] Automagic Invoices #197

JustSamuel opened this issue Jul 3, 2024 · 4 comments

Comments

@JustSamuel
Copy link
Contributor

What would you like?

Create automatic invoices for enabled users. These invoices will be more like receipts and should make it easier for the BACPM.

Why is this needed?

  • Other clubs don't have to wait for the BAC treasurer to eventually decide to send an invoice, because SudoSOS will send the invoice immediately at night.
  • The BAC treasurer doesn't have to make petty invoices of a few euros and invoices.
  • The BAC treasurer no longer has to look after all these accounts.

How could it be implemented?

Automatic invoices will be separate from normal invoices. The BACPM can still make manual invoices (for things such as CEB account).

The implementation will be that automatic invoices should be counted in the "transactionOverview" where as manual invoices are not. This could be tricky, so this should be done carefully.

We can use an internal reference on the invoice (SUDOSOSXXXX) which will make it clear that it is an automatic invoice. It was also suggested that an automatic invoice also create a "paymentRequest" from stripe such that an account can instantly pay using stripe. This will allow us to send payment links (hopefully that doesn't kill our spam score)

But the main gist is to turn automatic invoices into automatic "receipts" which will be paid for through SudoSOS. This also means that they do not have to be incorporated into the BAC bookkeeping as they will be reported within the transactionOverview.

Other information

No response

@tomudding
Copy link
Member

It was also suggested that an automatic invoice also create a "paymentRequest" from stripe such that an account can instantly pay using stripe. This will allow us to send payment links (hopefully that doesn't kill our spam score)

What would the payment links look like? I assume you will get some URL that looks like {sudosos_domain}/invoice/{long_random_string} that prompts you with the interface from the paymentRequest?

How will you handle expiration of URL/invoice? How will you deal with accidental double payments because Stripe's webhooks are delayed?

@JustSamuel
Copy link
Contributor Author

It was also suggested that an automatic invoice also create a "paymentRequest" from stripe such that an account can instantly pay using stripe. This will allow us to send payment links (hopefully that doesn't kill our spam score)

What would the payment links look like? I assume you will get some URL that looks like {sudosos_domain}/invoice/{long_random_string} that prompts you with the interface from the paymentRequest?

How will you handle expiration of URL/invoice? How will you deal with accidental double payments because Stripe's webhooks are delayed?

I was more thinking that you get a link like sudosos.gewis.nl/pay/HASH and it follows the almost exact same flow as the topup. Difference would be that in this case the amount is not variable and invoice users can "top up".

@tomudding
Copy link
Member

tomudding commented Jul 3, 2024

The reason I am asking this is because Stripe also have an invoice service, which could prevent us from abusing PaymentRequests and not have to deal with iDEAL payments not working for some people. It can also handle expiry automatically and I would assume that you would not have to implement any logic to prevent double payments.

However, that requires a bit more setup and has some other issues that are difficult or impossible to solve (e.g. generic treasurer e-mail address instead of BAC treasurer). So I think your suggestion is preferable but requires proper testing to ensure it cannot break.

Stripe invoice:
image

Stripe e-mail:
image

Payment page ('invoice: no' because this is a draft):
image

@Yoronex
Copy link
Member

Yoronex commented Jul 30, 2024

We have decided to implement this all within SudoSOS, but it will require some extra work and things to keep in mind:

  • Invoices need to be refactored (again): currently, each transaction can have at most one invoice related to it. This can be either an debit invoice or credit invoice. However, there exists (many) use cases in which transactions need to be linked to both types of invoice. For example, when an invoice user buys a "borrelkaart" at the borrel and is sent an automatic invoice, this transaction should be both on the automatic invoice (debit) and the transaction overview for the financial statement (credit).
  • We must have separate Stripe redirects in the frontend for topup's (in which case the user is authenticated) and for automatic invoice payments (in which case the user is not authenticated).
  • For invoice users, the frontpage of the SudoSOS dashboard should not show the balance (because it is probably always zero), but a list of their open invoices instead. Via this page, people should also be able to pay their invoices.
  • For the BAC treasurer, there should be a list of all open automatic invoices. When an invoice is overdue, this should be highlighted.
  • We should disallow changing automatic invoices to manual invoices and vice versa. We have had a long discussions with BAC treasurer(s) and the conclusion was that changing "the past" would bring a lot of extra work, as these changes have to be applied to Multivers as well. Therefore, automatic invoices can only be paid using the provided payment link. SudoSOS should send frequent reminders (every week?) to people with open invoices that they have to pay for these invoices.
  • If an automatic invoice is marked as overdue, the BAC Treasurer is responsible that this invoice is paid via SudoSOS using the payment link. The treasurer should therefore also have access to this link and the corresponding invoice files, so they can manually "schop" people to pay.
  • In the absolute worst case that someone is unable to pay directly via SudoSOS, but can only pay via e.g. a bank transfer, the BAC Treasurer can still receive the invoice money on the ABN Amro and then pay in SudoSOS using the payment link themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants