title: Error success is not a function in Angularjs
body: <p>I am facing a problem with my code I can't understand whats going wrong on it..
  interesting things is that api is calling quite good but its not going into <code>success</code> function
  <code>orders.pay(ss($scope.ss, $scope.oo))
            .success(function (data) {</code></p>
  
  <pre><code>angular.module('services.orders', ['users.service'])
    .factory('orders', ['$http', 'user', '$q', function ($http, user, $q) {
      'use strict';
  
  function genericSuccess (res) {
        return res.data.data; // yes, really.
      }
  
  
  function pay (payment) {
        return $http.post('v1/payment/authorize', payment)
          .then(genericSuccess);
      }
  
  
  
  orders.pay(ss($scope.ss, $scope.oo))
            .success(function (data) {
  
      //It should called success either it should gone to error but it says
      //Error:orders.pay(...).success is not a function
      //can any one suggest how to solve it
  
              notify.message('Thank you!');
            }).error(function (data) {
            notify.message('Error: ' + data.data.message);
          });
  </code></pre>