sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

Allow dedicated payment and receipt for license edits #7478

Open novoselt opened 6 months ago

novoselt commented 6 months ago

E.g. if there are now 4 more students enrolled in the course, the administrator may prefer to edit the course license and pay separately, even if there are funds on the account, because those funds are ear-marked for other purposes.

Having a detailed description on the receipt that "this is for license edit from this_state to that_state" is a huge bonus.

An easiest and quite flexible way to implement it may be supporting a "license edit" product in the cart, so that it is treated the same way as everything else for checkout purposes.

Potential issue - when a live license is edited, the price is calculated "from now" and if several license edits are loaded into card, there may be a bit of a delay from staging the edit to actually executing it, with effective date in the past. I think that having that date in the past by 1 hour and collecting/accepting the charge for it is perfectly reasonable. If it is more than that, maybe some actions may be taken.

A possible approach - make license edit items in the cart live: recompute their start date and price when the cart is actually shown. Then if somebody is editing a bunch of licenses before paying the price may drop a little (it cannot go up). I would NOT change the amount from what is shown to the user to what is sent to Stripe, however, that's just confusing.

williamstein commented 6 months ago

An easiest and quite flexible way to implement it may be supporting a "license edit" product in the cart, so that it is treated the same way as everything else for checkout purposes.

Unfortunately, it would be significantly more difficult to implement than just adding an option during the license edit process to pay via a new transaction.

williamstein commented 6 months ago

A workaround for this problem could be to support having a user customizable invoice/receipt with line items when purchasing a cash voucher. If the license edit costs $17.34, you could buy a cash voucher for $17.43 that says "Cash voucher to add 4 students to my course...", pay for it via a new credit card transaction, and then later use that credit to edit the license in the usual way.

novoselt commented 6 months ago

"CoCalc credit voucher ..." or just "Voucher ..." without any mention of cash or money ;-)

It think that would be fine solution - the checkout dialog can be kept to a minimum, but with a clear link like

"Need an explicit invoice for this edit? Read this BEFORE completing your purchase!"