QB64.org Forum
Active Forums => Programs => Topic started by: loudar on May 16, 2020, 08:36:43 pm
-
Hey you all!
I don't know if this is 100% the right board, but I think so?
Anyway, as a little side-project I've been working on getting licensing in QB64 to work. I'm using Gumroad for the licensing, since it's easy, reliable and commonly used. Feel free to suggest more to implement if you want!
Just paste the function into your code, feed it with a license key and modify the IF-ELSE at the bottom to your needs.
Feel free to use a key you generated yourself via defining devkey$ to get rid of the limitations of standard keys.
checkLicense = 1
shellcmd$
= "cmd /c curl http://api.gumroad.com/v2/licenses/verify -d " + CHR$(34) + "product_permalink=XXun" + CHR$(34) + " -d " + CHR$(34) + "license_key=" + license$
+ CHR$(34) + " > license.txt" p = 0
u = 0
o = 0
p = p + 1
u = p
attribute$
= MID$(licensecallback$
, p
+ 1, u
- p
- 1) IF attribute$
<> "purchase" AND attribute$
<> "custom_fields" AND attribute$
<> "How did you discover Datanet?" AND attribute$
<> "variants" THEN o = u
value$
= MID$(licensecallback$
, u
+ 3, o
- u
- 4) value$
= MID$(licensecallback$
, u
+ 2, o
- u
- 2) p = o
CASE IS = "success": success$
= value$
CASE IS = "seller_id": sellerID$
= value$
CASE IS = "product_id": productID$
= value$
CASE IS = "product_name": productname$
= value$
CASE IS = "permalink": permalink$
= value$
CASE IS = "product_permalink": productpermalink$
= value$
CASE IS = "email": email$
= value$
CASE IS = "currency": currency$
= value$
CASE IS = "order_number": ordernumber
= VAL(value$
) CASE IS = "sale_id": saleID$
= value$
CASE IS = "sale_timestamp": saletimestamp$
= value$
CASE IS = "purchaser_id": purchaserID
= VAL(value$
) CASE IS = "test": test$
= value$
CASE IS = "How did you discover Datanet?": discovery$
= value$
CASE IS = "license_key": licensekey$
= value$
CASE IS = "ip_country": IPcountry$
= value$
CASE IS = "is_gift_receiver_purchase": isgift$
= value$
CASE IS = "refunded": refunded$
= value$
CASE IS = "disputed": disputed$
= value$
CASE IS = "dispute_won": disputewon$
= value$
CASE IS = "created_at": createdat$
= value$
CASE IS = "variants": variants$
= value$
CASE IS = "chargebacked": chargebacked$
= value$
CASE IS = "ended_at": endedat$
= value$
CASE IS = "failed_at": failedat$
= value$
DO: p
= p
+ 1:
LOOP UNTIL MID$(licensecallback$
, p
, 1) = "{" OR MID$(licensecallback$
, p
, 1) = "[" OR MID$(licensecallback$
, p
, 1) = "," attribute$ = ""
value$ = ""
IF success$
= "true" AND uses
< 100 AND productname$
= "Datanet" AND permalink$
= "XXun" AND licensekey$
= license$
AND endedat$
= "" AND failedat$
= "" THEN checkLicense = 1
-
Does this licensing company also stop Windows 10 from not knowing who the programmer is? When it doesn't know who the programmer is, it sends a huge warning to the person that runs the .exe you make unless you are running it yourself. This stopped me from putting .exe's on my old website or selling anything. I looked into it once and Microsoft charges around $150 or so. There's still a way for people to run your exe's but it's a pain.
-
Well, I guess it's the standard "Yes, trust this application please" but finding a way around that would be neat, that's true.
And I just use it as a gateway to distribute the software, nothing more really. But found that it could be interesting at least.