public DwollaResponse <string> SendFunds(SendTransactionOptions options)
        {
            var url = Urls.Transactions + "/send";

            var client = new RestClient();

            var data = new {
                oauth_token       = options.OAuthToken,
                pin               = options.Pin,
                destinationId     = options.DestinationId,
                amount            = options.Amount,
                assumeCosts       = options.AssumeCosts,
                destinationType   = options.DestinationType,
                facilitatorAmount = options.FacilitatorAmount,
                fundsSource       = options.FundsSource,
                notes             = options.Notes,
            };

            var request = new RestRequest(url, Method.POST)
            {
                RequestFormat = DataFormat.Json
            };

            request.AddBody(data);

            var response = client.Execute(request);

            return(Mapper <DwollaResponse <string> > .MapFromJson(response.Content));
        }
        public DwollaResponse<string> SendFunds(SendTransactionOptions options)
        {
            var url = Urls.Transactions + "/send";

            var client = new RestClient();

            var data = new {
                oauth_token = options.OAuthToken,
                pin = options.Pin,
                destinationId = options.DestinationId,
                amount = options.Amount,
                assumeCosts = options.AssumeCosts,
                destinationType = options.DestinationType,
                facilitatorAmount = options.FacilitatorAmount,
                fundsSource = options.FundsSource,
                notes = options.Notes,
            };

            var request = new RestRequest(url, Method.POST) {
                RequestFormat = DataFormat.Json
            };

            request.AddBody(data);

            var response = client.Execute(request);

            return Mapper<DwollaResponse<string>>.MapFromJson(response.Content);
        }
Esempio n. 3
0
        public void It_should_send_funds()
        {
            // arrange
            var transactionService = new DwollaTransactionService();

            var options = new SendTransactionOptions {
                OAuthToken = TestOAuthToken,
                Pin = TestPin,
                DestinationId = _dwollaReflectorId,
                Amount = 1,
                FacilitatorAmount = 0
            };

            // act
            DwollaResponse<string> response = transactionService
                .SendFunds(options);

            // a successful transaction returns a transactionId

            // assert
            response.Success.ShouldBeTrue();
        }