Language: JavaScript
Label: safe
CWE: CWE-829 \u2014 Inclusion of Functionality from Untrusted Control Sphere
The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.

Code:
        success: function (data, status) {
            if (status == "success") {
                //Remove the loading icon from button
                $(submitter).html("Printing...");

                var saleStatus = JSON.parse(data);

                // Redirect to sale invoice print page
                if (saleStatus["saleStatus"] === "success") {

                    BMS.MAIN.printPage(full_website_address + "/invoice-print/?invoiceType=posSale&id=" + saleStatus["salesId"], event, function () {

                        // Hide the payment modal
                        $('#payment').modal('hide');

                        // Clear POS Screen
                        BMS.POS.clearScreen();

                        // enable submit button after ajax request complete
                        $("#payment").find("button").prop("disabled", false);

                    });

                } else {

                    $("#posErrorMsg").html('<div class="alert alert-danger">' + saleStatus["msg"] + '</div>');

                    // enable submit button after ajax request complete
                    $("#payment").find("button").prop("disabled", false);

                }

            }
        }