I am new in angularjs, integrating paytm wallet in my web app. when i am sending request paytm server from my angular js function , it is showing this error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://pguat.paytm.com/oltp-web/processTransaction?orderid=data.ORDER_ID. (Reason: CORS request failed).
here is my function
function sendDataToPaytm(data)
{
var defer = $q.defer();
console.log(data);
$http.defaults.headers.common['Access-Control-Allow-Origin'] = "*";
$http.defaults.headers.common['Access-Control-Allow-Methods'] = "POST, GET, OPTIONS, PATCH, DELETE";
$http.defaults.headers.common['Access-Control-Allow-Headers'] = "Origin, X-Requested-With, Content-Type, Accept";
console.log($http);
console.log();
var url = 'https://pguat.paytm.com/oltp-web/processTransaction?orderid=data.ORDER_ID';
$http.post(url, data, headers)
.success(function(data, status, headers, config){
defer.resolve([status, data]);
})
.error(function(data, status, headers, config){
//console.log("Error in getting sellers info");
defer.resolve([status, data]);
});
return defer.promise;
}
please help me to solve this