Problem/Motivation
Let's port Commerce License.
Proposed resolution
The main change we're making is to merge the role of Commerce Recurring (for products and orders) and Commerce License Billing (for subscriptions) into a single module which will leverage the plugin system to serve both roles. There is a spec document for this which I'm going to turn into issues in the queues over the coming days. ??Can we link to these or list them in the remaining tasks???
Remaining tasks
List here the outstanding tasks for an Alpha 1.
The minimum needed for an alpha:
#2879261: Entity scaffolding
#2879301: Time handling and periodic field/form element type (?)
Nice to have for an alpha:
Original summary
Okay. Sorry for the delay everyone. I started on this and then was waylaid by both travel and real life crap for nearly a month. We are proceeding with the port of this module backed by Platform.sh and AcroMedia, with supporting fire from the core Commerce Guys team. Here is the announcement I wrote in the Drupal #commerce Slack channel, which is where most of the development feedback and discussion here will happen:
Ok I'm going to write this while I have the time. My schedule has been a bit wild but I am actively pursuing ports of the Commerce License and Commerce License Billing suite to Drupal 8 + 2.x. We discussed this at the Paris sprint in January and finally I'm following up with support from AcroMedia and Platform (this will also involve cleaning up and making final releases of the 7.x/1.x modules.)
The main change we're making is to merge the role of Commerce Recurring (for products and orders) and Commerce License Billing (for subscriptions) into a single module which will leverage the plugin system to serve both roles. There is a spec document for this which I'm going to turn into issues in the queues over the coming days. I already have a bunch of scaffolding for the Commerce License module and there will be issues for the remainder of that port shortly also, so anyone interested can feel free to take a crack at various small tasks.
I will probably set up a weekly office hours for this overall Big Project sometime next week after conferring with Bojan. One of our big goals is to make this a core supported component of Drupal Commerce 2.x and have recurring implementations be as natural and seamless as in any recurring-focused SaaS product out there.
Some other stuff:
- I'm going to personally follow up with others who have started ports before. I wanted to get some ground up scaffolding in place first to wrap my head around what is needed. The intention is not to discard the work of others but to bring it in piecemeal as patches. No offense was intended, I just got distracted right after taking the first major step and it looked bad.
- To systematize my own work on this as well as provide an easy way for others to help, my second step was to sit down and document (very roughly) the main logic points that are required for Commerce License to work. These will all be turned into linked issues, but my notes will appear in the first comment to this issue.
Comments
Comment #2
Kazanir CreditAttribution: Kazanir at Platform.sh for Acro Commerce commentedComment #3
joachim CreditAttribution: joachim as a volunteer commentedWe are nearly at the point of customers purchasing a license that does something: just need these issues wrapping up:
- #2879263: License creation/destruction logic in sync with cart/order lifecycle
- #2899897: API for activating and deactivating license on state change
- #2899878: add a method to License to set values from a configured plugin
- #2886820: add configuration form and bundle fields to Role license type plugin
Comment #4
heddnComment #5
chrisrockwell CreditAttribution: chrisrockwell commentedAdding #2879301: Time handling and periodic field/form element type (?) for alpha since I don't think we can use this without. AFAIK it doesn't default to unlimited.
Comment #6
joachim CreditAttribution: joachim as a volunteer commentedI'm tagging issues as 'Novice', for people who want to help but don't feel they have the skills or familiarity with the code: https://www.drupal.org/project/issues/search/commerce_license?project_is...
Comment #7
Lukas von BlarerThis needs a IS update. Alpha is released. We should have a list of issues needed for a beta release and the stable release to make it easier to contribute. @joachim could you do that?
Comment #8
joachim CreditAttribution: joachim as a volunteer commented> We should have a list of issues needed for a beta release and the stable release to make it easier to contribute. @joachim could you do that?
I made a list of missing features for my presentation at DrupalEurope, so I'll dig that out and check there is an issue for each item.
Comment #9
joachim CreditAttribution: joachim as a volunteer commentedRough notes:
- #2943888: Add the ability to re-purchase a license to extend it
- #2999408: add a security warning to the role license in product variation type configuration
- #2906595: Implement license handling on user deletion / block
- #2879278: Cart license forms
- #2906251: Allow user to configure when license starts
Comment #10
joachim CreditAttribution: joachim as a volunteer commentedHere's my 'What's next' slide from my presentation at DrupalEurope:
These were also in the list in my presentation, but are on Commerce Recurring:
Comment #11
Lukas von BlarerThank you! Is there a recording of your session?
Which of the issues are required for a beta release and which are targeted for the stable release? That overview would help a lot to collaborate and evaluate commerce_license.
Comment #12
joachim CreditAttribution: joachim as a volunteer commented> Thank you! Is there a recording of your session?
It was recorded, but I don't know if it's available yet. Maybe ask @DrupalEurope on twitter?
> Which of the issues are required for a beta release and which are targeted for the stable release? That overview would help a lot to collaborate and evaluate commerce_license.
I would say for beta we need:
- Customer UI to view licenses
- For OG license support, some way of allowing customers to select values for their license, whether it's either of:
-- Checkout form for license entity
-- Add to cart form additions for license entity
- It would also be nice to figure out how remote licenses are going to work before we hit a beta, as it might have implications for the API, but as I have NO idea about the use cases or how it's meant to work, I don't think it's going to happen.
For the rest, it depends on what your own use case is and what features you need. For example, I considered 'Re-purchase a product to extend a license' a nice-to-have, but it's ended up getting lots of work done on it because someone needs it for their site.
Comment #13
zenimagine CreditAttribution: zenimagine commentedHello, I work on a marketplace project (several store and owner on the same site).
Here are its operation (example for two stores):
- the store "A" belongs to the user "1" and contains 20 products.
- the store "B" belongs to the user "2" and contains 50 products.
The shop owner must buy a recurring license (every month), to sell online.
If the user "1" does not have a license, visitors can see the products of the store "A", but they can not buy them online.
For example by automatically disabling the "Add to Cart" button.
Can the license module do that?
Is it stable enough for a site in production?
Comment #14
joachim CreditAttribution: joachim as a volunteer commented> For example by automatically disabling the "Add to Cart" button.
> Can the license module do that?
You'll need a custom license plugin for that part.
> Is it stable enough for a site in production?
Probably... It's in use on several production sites, but as it's still in alpha, API may change. So you'll need to manage any custom code you have, and also keep an eye on the state of the module for any changes.
Comment #15
zenimagine CreditAttribution: zenimagine commented@joachim Thank you. I see that there is a module "Recurring Time Period".
What is the difference with "Commerce Recurring"?
Comment #16
joachim CreditAttribution: joachim as a volunteer commentedYou're taking this issue further and further off-topic -- please read the READMEs!
Comment #17
mrweiner CreditAttribution: mrweiner commentedAre there issues tracking the state of these needs/tasks? You note that they are "on Commerce Recurring", but wouldn't the issues be related to this module since Commerce Recurring is being integrated into Commerce License? I've got a build on the horizon that will require at least 2 and 3, and possibly 1, so I'm interested in contributing to dev but haven't worked on any ports before so not sure what the overhead is.
On another note, do you know if there are any plans for migration of licenses from D7 to D8?
Comment #18
mrweiner CreditAttribution: mrweiner commentedI try not to bump issues, but given that my last post was ~5 months it seems alright. Still interested in helping! :)
Comment #19
joachim CreditAttribution: joachim as a volunteer commented> Are there issues tracking the state of these needs/tasks?
In some cases yes, but I'm not sure any more. If you can't find an issue, feel free to create one.
> wouldn't the issues be related to this module since Commerce Recurring is being integrated into Commerce License
It depends which module they come under!
> On another note, do you know if there are any plans for migration of licenses from D7 to D8?
No, though I did do a migration and I could dig out the code. I thought I put some of it into License already.
Comment #20
bojanz CreditAttribution: bojanz at Centarro commentedIt's now been two years since the first Commerce Recurring betas, and their use on various sites. Recurring itself is close to its first production-ready RC1 release (though it remains to be seen when there will be enough funding or Centarro time for that to happen). License remains a bit stuck on the road to beta due to lack of backing (sponsors, please reach out to joachim).
The Recurring+License combo has seen enough usage for us to be able to draw some conclusions. My impression is that users are generally confused about how License and Recurring interact, and what is provided by which module. The duplication between license expiration settings (which are not used in a recurring context) and billing schedules (provided by recurring) is a frequent discussion point on Drupal Slack. Furthermore, license doesn't provide a lot in a recurring context. In D7 the license entity also served as a subscription entity, but in D8 the recurring module has its own subscription entity.
So, my conclusion is this: We should encourage people to use either License or Recurring, never both. Use License for manual billing (buy a product to get access, re-buy the product to extend access). Use Recurring for automatic billing (buy product to get access, get billed weekly/monthly/yearly etc). Modules that allow licensing files/media/etc should integrate with both, providing both a license type plugin and a subscription type plugin, with the real logic in a shared service as needed. This clarity will also make it easier to develop both modules, since their use cases are now better defined.
Note that for this to be doable we need to support awarding roles from Recurring only: #3108259: Add a subscription type for roles
Comment #21
zenimagine CreditAttribution: zenimagine commentedThank you, have you planned one in this update, uninstalling the module? Currently impossible to remove the module from a site.
Comment #22
dercheffeHi,
I implemented 2 checkout flows in my site with commerce and commerce_licence: One for private customers and one for business customers. In my case manual billing and automatic recurring are both required. IMO it should be possible to co exist the two modules so a site builder is able to decide what way he want to choose for each customer journey.
Second point is that I don't really understand why there is a commerce recurring framework as a standalone module.
Normally in a online shop selling physical products (e.g. let's say a t-shirt), I buy it once and pay once. The recurring functionality makes more sense when selling a digital product like a site access or am I wrong? The name "commerce license" is more intuitive for a commerce noob like I'm one :)
So what's speaking against merging reccurring functionality in commerce license and have at the end one module with a intuitive name?
The site builder or the user itself (depending on site configuration) should also have a choice to disable auto recurring a access by default when purchase a product or later during a view, a field etc (As far as I know there is already a issue for that: #3091587)
Edit:
If there is no way that commerce_license and commerce_recurring_framework can co-exist at one site will there be an upgrade path later?
This would be very important imo to avoid problems with license contracs.
Comment #23
joachim CreditAttribution: joachim as a volunteer commented> We should encourage people to use either License or Recurring, never both.
It's been a while since I finished working on the project I built License for, but I'm fairly sure we had some products that were one-off purchases, and some that were recurring subscriptions.
> Second point is that I don't really understand why there is a commerce recurring framework as a standalone module.
IIRC it's because the plan was that Recurring could also handle things like post-paid subscriptions for things like metered usage, which would not involve a license. Or possibly things like recurring orders that are for physical products, e.g. 'order the same basket of groceries every week'.
> Modules that allow licensing files/media/etc should integrate with both, providing both a license type plugin and a subscription type plugin, with the real logic in a shared service as needed.
That doesn't sound like elegant architecture to me. It might be the quickest fix given the lack of support for these modules, but it doesn't seem like the best fix.
Comment #24
bojanz CreditAttribution: bojanz at Centarro commentedMy point exactly. If we continue chasing the most complex requirements while having 0 funding and very little community engagement, we'll reach 2022 in the same alpha/beta non-production-ready state.