예제 #1
0
        public void It_should_register_a_new_dwolla_user()
        {
            // arrange
            var registerService = new DwollaRegisterService();

            var options = new RegisterOptions {
                ClientId     = TestAppKey,
                ClientSecret = TestAppSecret,
                Email        = TestEmail,
                Password     = "******",
                Pin          = "1111",
                FirstName    = "TestFirst",
                LastName     = "TestLast",
                Address      = "555 Not Real",
                City         = "Seattle",
                State        = "WA",
                Zip          = "98119",
                Phone        = "2065551234",
                DateOfBirth  = new DateTime(1980, 1, 1),
                AccountType  = "Personal",
                AcceptTerms  = true
            };

            // act
            DwollaResponse <DwollaUser> response = registerService.RegisterUser(options);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #2
0
        public void It_should_return_a_list_of_the_users_contacts()
        {
            // arrange
            var contactService = new DwollaContactService();

            // act
            DwollaResponse <IList <DwollaContact> > response = contactService.GetUserContacts(TestOAuthToken);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #3
0
        public void It_should_return_a_users_full_account_info()
        {
            // arrange
            var userService = new DwollaUserService();

            // act
            DwollaResponse <DwollaUser> response = userService.GetFullAccount(TestOAuthToken);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #4
0
        public void It_should_return_a_users_basic_account_info()
        {
            // arrange
            var    userService = new DwollaUserService();
            string userId      = "812-608-0250";

            // act
            DwollaResponse <DwollaUser> response = userService.GetBasicAccount(userId, TestAppKey, TestAppSecret);

            // assert
            response.Success.ShouldBeTrue();
        }
        public void It_should_retrieve_a_lists_of_funding_sources()
        {
            // arrange
            var fundingService = new DwollaFundingService();

            // act
            DwollaResponse <IList <DwollaFund> > response = fundingService
                                                            .List(TestOAuthToken);

            // assert
            response.Success.ShouldBeTrue();
        }
        public void It_should_get_a_funding_source_by_id()
        {
            // arrange
            var fundingService = new DwollaFundingService();

            // act
            DwollaResponse <DwollaFund> response = fundingService
                                                   .GetById(TestOAuthToken, TestFundId);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #7
0
        public void It_should_list_pending_requests()
        {
            // arrange
            var requestService = new DwollaRequestService();

            // act
            DwollaResponse <IList <DwollaRequest> > response = requestService
                                                               .ListPending(TestOAuthToken);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #8
0
        public void It_should_return_a_list_of_nearby_contacts()
        {
            // arrange
            var contactService = new DwollaContactService();

            // act
            DwollaResponse <IList <DwollaContact> > response = contactService.GetNearbyContacts(
                TestAppKey, TestAppSecret);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #9
0
        public void It_should_get_request_by_id()
        {
            // arrange
            var requestId      = "955";
            var requestService = new DwollaRequestService();

            // act
            DwollaResponse <DwollaRequest> response = requestService
                                                      .GetRequest(TestOAuthToken, requestId);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #10
0
        public void It_should_get_transaction_by_oauth_token_and_id()
        {
            // arrange
            const string transactionId = "1240235"; // Todo: Remove TransactionId

            var transactionService = new DwollaTransactionService();

            // act
            DwollaResponse <DwollaTransaction> response = transactionService
                                                          .GetById(transactionId, TestOAuthToken);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #11
0
        public void It_should_get_transaction_by_app_credentials()
        {
            // arrange
            const string transactionId = "1240235"; // Todo: Remove transactionId

            var transactionService = new DwollaTransactionService();

            // act
            DwollaResponse <DwollaTransaction> response = transactionService
                                                          .GetById(transactionId, TestAppKey, TestAppSecret);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #12
0
        public void It_should_fulfil_a_request()
        {
            // arrange
            var requestService = new DwollaRequestService();

            var options = new FulfillOptions {
                OAuthToken = TestOAuthToken,
                RequestId  = "111",
                Pin        = "1111"
            };

            // act
            DwollaResponse <DwollaRequest> response = requestService.Fulfill(options);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #13
0
        public void It_should_deposit_funds_from_funding_source()
        {
            // arrange
            var fundingService = new DwollaFundingService();

            var options = new TransferOptions {
                OAuthToken  = TestOAuthToken,
                Pin         = TestPin,
                FundsSource = TestFundId,
                Amount      = 1
            };

            // act
            DwollaResponse <DwollaTransaction> response = fundingService
                                                          .Deposit(options);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #14
0
        public void It_should_list_a_users_transactions()
        {
            // arrange
            var transactionService = new DwollaTransactionService();

            var options = new ListTransactionOptions {
                // OAuth token required
                OAuthToken = TestOAuthToken,

                // get transactions from last 2 days
                SinceDate = DateTime.Now.AddDays(-2).ToString()
            };

            // act
            DwollaResponse <IList <DwollaTransaction> > response = transactionService
                                                                   .GetByUser(options);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #15
0
        public void It_should_retrieve_transaction_stats_by_oauth()
        {
            // arrange
            var transactionService = new DwollaTransactionService();

            var options = new TransactionStatsOptions {
                // OAuth token required
                OAuthToken = TestOAuthToken,

                // get transactions from the previous month
                StartDate = DateTime.Now.AddMonths(-1).ToString()
            };

            // act
            DwollaResponse <DwollaTransactionStats> response = transactionService
                                                               .GetTransactionStats(options);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #16
0
        public void It_should_make_transaction_request()
        {
            // arrange
            var requestService = new DwollaRequestService();

            var options = new RequestTransactionOptions {
                // required options
                OAuthToken = TestOAuthToken,
                SourceId   = _dwollaReflectorId,
                Amount     = new decimal(1.50),

                // optional
                SourceType = "Dwolla"
            };

            // act
            DwollaResponse <string> response = requestService.Request(options);

            // assert
            response.Success.ShouldBeTrue();
        }
예제 #17
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();
        }