Angularjs alertservice and alertscontroller
So far, your code looks good. But here's some suggestions.

It's usually overkill to pull out success and error callbacks. You can simply inline them. Also, if you happen to have ES6 available via transpiler or if you just don't care about older browsers, by all means use it. It makes the code a lot shorter.

return $http.post('/api/payment', {
  id,
  paymentMethod,
  numberOfInstallments,
  creditCard,
  pin
}).then( _ =&gt; {
  alertService.success('Payment confirmed.');
}, _ =&gt; {
  alertService.success(response.data);
});


Angular also allows for implicit dependencies. Instead of an array of dependency names and a function at the end of the array, you can simply provide a function whose arguments are the name of the dependencies. Saves you keystrokes. 

app.service('PaymentService', ['$http', 'AlertService', function ($http, alertService) {...}]);

app.service('PaymentService', function($http, AlertService){...});