Add the ability to re-purchase a license to extend it

Created on 11 February 2018, over 6 years ago
Updated 25 May 2023, about 1 year ago

(I could have sworn there was an issue for this, but I can only find a 7.x one that I don't want to hijack.)

Rough notes:

- the availability checker for ownership of a grantable gets in the way
- we probably still need to prevent re-purchase of a license product early on in the license's lifetime. That suggests a setting on the PV to say 'renewals may be purchased within interval X from expiry'.
- the availability checker thus needs to know whether there is a license, as well as the grantable. The logic becomes:

 - got license? yes:
    - is it unlimited? may not purchase
    - are you in the renewal period? yes: may purchase
 - got license? no:
    - do you have the grantable? yes: may not purchase

- the cart should show a clear message that the user is purchasing a renewal, and what date they are extending to
- something needs to place the existing license on the order item in the new order
- the order sync class needs to know it's a renewal, and at the point where it would normally activate, extend instead
- the code that deletes a license when an order item is deleted needs to account for this process, and NOT delete the license
- tests. all the tests.

Tests that needs to be done:

    1. buy a license
    2. complete the order
    3. buy the same license in the renewable window
    4. complete the order
    5. see that the expires has been augmented of the license duration
    1. buy a license
    2. complete the order
    3. buy the same license in the renewable window
    4. stop at the cart state
    5. remove the product from the cart
    6. see that the license in the active state and the expire time has been untouched
✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024