title: Cross-Origin Request Blocked: (Reason: CORS request failed). in angularjs
body: <p>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:</p>
  
  <blockquote>
    <p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="https://pguat.paytm.com/oltp-web/processTransaction?orderid=data.ORDER_ID" rel="nofollow">https://pguat.paytm.com/oltp-web/processTransaction?orderid=data.ORDER_ID</a>. (Reason: CORS request failed).</p>
  </blockquote>
  
  <p>here is my function</p>
  
  <pre><code>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;
  }
  </code></pre>
  
  <p>please help me to solve this</p>