I have ASP.NET MVC project with form I need to send as httpRequestObject
. I'm trying for few days already to make simple XMLhttp
request to 3rd party Credit card clearing company URL and get back the response with redirect which on XML format - I don't care if redirection made by iframe
or popup checked all over the internet for solutions
checked all solutions here but still nothing work. checked if I'm blocked in any way like proxy or firewall, and it's not the issue.
I tried with AJAX as well -
function createMPITransaction() {
var terminal_id = "0962832";
var merchant_id = "938";
var user = "user";
var password = "password";
var url="https://cguat2.creditguard.co.il/xpo/Relay";
var xmlStr = "xml data"
var data = xmlStr;
$.ajax({
type: "POST",
dataType: 'XML',
data: data,
url: url,
username: user,
password: password,
crossDomain: true,
xhrFields: {
withCredentials: true
}
})
.done(function( data ) {
console.log("done");
alert(xhr.responseText);
alert(textStatus);
})
.fail( function(xhr, textStatus, errorThrown) {
alert(xhr.responseText);
alert(textStatus);
});
alert(data);
}
I get on the console -
XMLHttpRequest cannot load "URL" No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
On network tab in chrome i see the XHR
with header and form - data but no response.
any help?