Support » Plugin: License Manager for WooCommerce » timesActivated not incrementing on activation
timesActivated not incrementing on activation
-
When activating the plugin via rest API the “timesActivated” value is not increment and is always “null”. Any solution or quick fix?
Thanks for the plugin
-
Hello @namithjawahar,
thank you for your message and for using my plugin.
I have a couple of questions:
- Are you using the v2 API routes?
- What does your request look like?
- What does your response look like?
Please let me know so that we can find a fix for this.
I am using the v2 API
Here is a sample response
{“success”:true,”data”:{“id”:”1″,”orderId”:”116″,”productId”:”83″,”licenseKey”:”1C4A-B22A-133C-4ACA”,”expiresAt”:null,”validFor”:null,”source”:”1″,”status”:”2″,”timesActivated”:null,”timesActivatedMax”:”5″,”createdAt”:”2019-10-20 16:09:48″,”createdBy”:”2″,”updatedAt”:”2019-10-20 16:09:48″,”updatedBy”:”2″}}
to the query
your URL looks a bit out of the ordinary. Is this a standard WordPress feature or some custom code? Also I noticed that you started your first GET parameter with a &. It should be a ?
Have you tried
https://mywebsite.com/wp-json/lmfwc/v2/licenses/activate/?license_key=1C4A-B22A-133C-4ACA&consumer_key=ck_blahblahblah6&consumer_secret=cs_blahblahblah`
-
This reply was modified 1 year, 6 months ago by
Drazen Bebic.
That URL is the non permalink version of the normally used one. It works.
Another question:
Are you doing a GET request?
Yes, I do get a response from the server with the license object. Its just not incrementing.
-
This reply was modified 1 year, 6 months ago by
Namith Jawahar.
do you have a test server where I could take a look myself? You could send me the login credentials to support@licensemanager.at
Sorry, Dont have a test server where the credentials can be shared. But this can be reproduced pretty easily. Create a product with licensing, place an order to generate a new key and use the API to activate the license. The “timesActivated” variable will be stuck on “NULL”
well that’s the thing, it absolutely works on my end, and it works on at least 2 other servers which I know of. I also got confirmation from some users that everything works on their end.
It must be something on your end.
Hello @namithjawahar,
were you able to figure this one out?
Yes, I just figured it out. The problem was with the rest API path. I had to repeat the “license_key” variable in the path too to match your regex. I didn’t delve into why it was returning a license object with the wrong path, it was probably getting matched with one of the other rest paths.
?rest_route=/lmfwc/v2/licenses/activate/license_key/&license_key=1234-B22A-5678-4ACA&consumer_key=ck_blahblahblah6&consumer_secret=cs_blahblahblah
Thanks
I’m glad you figured it out, kudos!
PS: I would greatly appreciate if you took some time out of your day to write a plugin review here on WordPress.org. Those reviews really help spread the plugin and mean a lot to me personally. Here’s the link:
https://wordpress.org/support/plugin/license-manager-for-woocommerce/reviews/#new-post
Have a great evening!
- The topic ‘timesActivated not incrementing on activation’ is closed to new replies.