Add activation limit support for LemonSqueezy licenses - #42
Add activation limit support for LemonSqueezy licenses#42mojtaba-nasehzadeh wants to merge 2 commits into
Conversation
- Stores the value persistently in the Extension License table - Provides public GetActivationLimit() procedure for consuming applications - Includes comprehensive error handling for missing data - Maintains backward compatibility - Supports both platforms (LemonSqueezy with data, Gumroad returns 0) - Makes the field visible in the Extension Licenses UI - Uses proper AL namespace structure and coding standards
|
Hi @JeremyVyska, would you mind reviewing this PR? |
|
One of my great frustrations with Interfaces? You can't change them once on AppSource. Any change to them at all is treated as a breaking change, even if you're just adding a new function. So, while I like this change, it'll fail when pushed to AppSource. We'd have to add a new "IActivationLimit" interface and add it to the system. |
|
@StefanMaron - see any issues? I think this makes sense and should pass validation now. |
StefanMaron
left a comment
There was a problem hiding this comment.
Is the activation limit really the limit? Or is it the remaining activations? Because if its the remaining activations, using 0 as unlimited will always allow unlimited activations
|
|
||
| // Find the license record by license key | ||
| SPBExtensionLicense.SetRange("License Key", LicenseKey); | ||
| if not SPBExtensionLicense.FindFirst() then begin |
There was a problem hiding this comment.
Remove begin .. end, add SetloadFields and ReadIsolation
| // If not stored locally, try to get from fresh API call | ||
| if CallAPIForActivation(SPBExtensionLicense, ResponseBody) then begin | ||
| PopulateSubscriptionFromResponse(SPBExtensionLicense, ResponseBody); | ||
| if SPBExtensionLicense.Modify() then begin |
| // If not stored locally, try to get from fresh API call | ||
| if CallAPIForActivation(SPBExtensionLicense, ResponseBody) then begin | ||
| PopulateSubscriptionFromResponse(SPBExtensionLicense, ResponseBody); | ||
| if SPBExtensionLicense.Modify() then begin |
| Caption = 'Activation Limit'; | ||
| DataClassification = SystemMetadata; | ||
| Editable = false; | ||
| ToolTip = 'The maximum number of activations allowed for this license. 0 indicates unlimited or information not available.'; |
There was a problem hiding this comment.
change to Specifies the maximum...
| "name": "Spare Brained Licensing", | ||
| "publisher": "Stefan Maron Consulting", | ||
| "version": "25.7.0.0", | ||
| "version": "26.5.37194.39023", |
There was a problem hiding this comment.
Please dont change the version manually as the pipelines will do that automatically
Add Dynamic Activation Limit Support for LemonSqueezy Licenses
This PR adds support for extracting and utilizing the activation_limit field from LemonSqueezy
API responses, enabling applications to implement dynamic user limits instead of hardcoding values.
Problem Statement
Current State: Applications using the SpareBrained Licensing framework hardcode user limits
Issue: This approach is inflexible and requires code changes to adjust user limits per license.
Goal: Enable dynamic user limits based on LemonSqueezy license configuration.