protected override void RunSample()
        {
            // ### Api Context
            // Pass in a `APIContext` object to authenticate
            // the call and to send a unique request id
            // (that ensures idempotency). The SDK generates
            // a request id if you do not pass one explicitly.
            // See [Configuration.cs](/Source/Configuration.html) to know more about APIContext.
            var apiContext = Configuration.GetAPIContext();

            // ### Retrieve the Billing Agreement
            // The billing agreement being retrieved is one that was previously created and executed using a PayPal account as the funding source.
            var agreementId = "I-6STR72E7JNP8";

            #region Track Workflow
            //--------------------
            this.flow.AddNewRequest(title: "Get list of recent billing agreement transactions", description: "ID: " + agreementId);
            //--------------------
            #endregion

            // Use `Agreement.Get()` to retrieve the billing agreement details.
            var agreementTransactions = Agreement.ListTransactions(apiContext, agreementId, "2014-09-01", "2015-01-01");

            #region Track Workflow
            //--------------------
            this.flow.RecordResponse(agreementTransactions);
            //--------------------
            #endregion

            // For more information, please visit [PayPal Developer REST API Reference](https://developer.paypal.com/docs/api/).
        }
        public void AgreementSearchTest()
        {
            var startDate    = "2014-10-01";
            var endDate      = "2014-10-14";
            var transactions = Agreement.ListTransactions(TestingUtil.GetApiContext(), "I-9STXMKR58UNN", startDate, endDate);

            Assert.IsNotNull(transactions);
            Assert.IsNotNull(transactions.agreement_transaction_list);
        }
Esempio n. 3
0
        public void AgreementSearchTest()
        {
            DateTime startDate    = new DateTime(2014, 10, 1);
            DateTime endDate      = new DateTime(2014, 10, 14);
            var      transactions = Agreement.ListTransactions(UnitTestUtil.GetApiContext(), "I-9STXMKR58UNN", startDate, endDate);

            Assert.IsNotNull(transactions);
            Assert.IsNotNull(transactions.agreement_transaction_list);
        }
Esempio n. 4
0
 public void AgreementSearchTest()
 {
     try
     {
         var startDate    = "2014-10-01";
         var endDate      = "2014-10-14";
         var transactions = Agreement.ListTransactions(TestingUtil.GetApiContext(), "I-9STXMKR58UNN", startDate, endDate);
         Assert.IsNotNull(transactions);
         Assert.IsNotNull(transactions.agreement_transaction_list);
     }
     catch (ConnectionException ex)
     {
         TestingUtil.WriteConnectionExceptionDetails(ex);
         throw;
     }
 }
Esempio n. 5
0
        public void AgreementSearchTest()
        {
            try
            {
                var apiContext = TestingUtil.GetApiContext();
                this.RecordConnectionDetails();

                var startDate    = "2014-10-01";
                var endDate      = "2014-10-14";
                var transactions = Agreement.ListTransactions(apiContext, "I-9STXMKR58UNN", startDate, endDate);
                this.RecordConnectionDetails();

                Assert.NotNull(transactions);
                Assert.NotNull(transactions.agreement_transaction_list);
            }
            catch (ConnectionException)
            {
                this.RecordConnectionDetails(false);
                throw;
            }
        }