hps / heartland-tokenization

SecureSubmit Tokenization Library
GNU General Public License v2.0
2 stars 2 forks source link

Ajax.jsonp error handling #54

Open elusivecube opened 6 years ago

elusivecube commented 6 years ago

Please add a way to detect if there is an issue with loading the requested payload into the script tag that this method creates and appends to the body, especially if the call to the requested payload link returns a server error.

            script.src =
                request.url +
                (request.url.indexOf("?") >= 0 ? "&" : "?") +
                "callback=" +
                callbackName +
                "&" +
                request.payload;
            document.body.appendChild(script);

In encountered an issue earlier today when attempting to test the tokenization using https://cert.api2.heartlandportico.com and each response was a server error.

Currently if such an error occurs, there is no error returned in the callback and it cannot be captured on the client side.