Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <reference path="../../../Gruntfile.js" />
- 'use strict';
- angular.module('exmapleApp')
- .factory('WithdrawalService', function (appConstants, $http) {
- var service = {
- getAllWithdrawals: function (successHandler) {
- //returns all withdrawal history for currently logged in user
- return $http.get(appConstants.api.url + '/withdrawals/getwithdrawals')
- .success(function (res) { successHandler(res); });
- },
- postWithdrawal: function (data, fnSuccess, fnError) {
- return $http.post(appConstants.api.url + '/withdrawals/withdraw', {
- amount: data.amount,
- fullName: data.fullName,
- phoneNumber: data.phoneNumber,
- paymentMethod: data.paymentMethod,
- paypalEmail: data.paypalEmail,
- mailingAddress: {
- AddressLine1: data.mailingAddress.AddressLine1,
- AddressLine2: data.mailingAddress.AddressLine2,
- City: data.mailingAddress.City,
- State: data.mailingAddress.State,
- PostalCode: data.mailingAddress.PostalCode,
- Country: data.mailingAddress.Country,
- }
- })
- .success(function (res) {
- fnSuccess(res);
- }).error(function (err) {
- fnError(err);
- });
- }
- };
- return service;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement