Help me please by use this code license_key?

Hello, everyone .
Is it possible to help me
The Consuelo gives the result of an error.

const license_key_ = async (license_key) => {
    try {
        var product_permalink = "bgXdo";
        url = "http://api.gumroad.com";
        reply = httpGet(url, 80);
        if (reply == "ok") {
            result = getSystemCommandStdout("curl -d \"product_permalink=" + product_permalink + "&license_key=" + license_key + "&increment_uses_count=true\" --ssl-no-revoke -X POST https://api.gumroad.com/v2/licenses/verify ");
            if (result != "undefined" && result != 0) {
                result = JSON.parse(result);
                if (result.success == true && (parseInt(result.purchase.quantity) * 2) >= parseInt(result.uses)) {
                    myRes = [result.success, result.uses, result.purchase.quantity, result.purchase.email];
                    return myRes;
                }
                if (result.success == false) {
                    myRes = showAlert();
                    return myRes;
                }
            }
        }
        if (reply == "no") {
            myRes = "unable to connect !";
            "Something went wrong";
            return myRes;
        }
        if ((parseInt(result.purchase.quantity) * 2) < parseInt(result.uses)) {
            myRes = showAlert1();
            return myRes;
        }
        console.log("license_key Result!!!")
    } catch (e) {
        console.error(e.message);
    }
}

The second code.

`const httpGet = async (url, port) => {
    try {
       if (url.substr(0, 7) == "http://") {
        url = url.substr(7)
    }
    if (!port) {
        port = 80
    }
    var domain = url.split("/")[0] + ":" + port;
    var reply = new String();
    var conn = new Socket();
    if (conn.open(domain)) {
        reply = "ok";
    } else {
        reply = "no";
    }
    return reply;
        console.log("httpGet Result!!!")
    } catch (e) {
        console.error(e.message);
    }
}`

What mistake have I made?
The result of the Consuelo.

With regards…
Mohamed Fathi…

Console tells you exactly what mistake you have made. You never defined Socket nor result. And once again, this has nothing to do with UXP, It’s just plain JavaScript

In addition to what @Karmalakas said, you may also want to refresh your knowledge on asynchronous (async) functions. Looking at the code I think there might be some issues with not awaiting calls to async functions, etc. My suggestion would also be to test the different components separately as small examples rather than trying out the whole thing at once. It might be worth checking out some of the UXP sample plugins, such as the websocket example (uxp-photoshop-plugin-samples/io-websocket-example at main · AdobeDocs/uxp-photoshop-plugin-samples · GitHub). Good luck! :slight_smile:

It’s none of my business really, but as a friendly side note and hint, I would maybe do some spell checking in your UI before release to make sure there are no spelling mistakes in titles/labels… :wink:

Thank you, my friends.
I will look at the example and study it in detail and try to solve the mistake I made