コード例 #1
0
        private void ExecuteBillingAgreement(APIContext apiContext, string token)
        {
            var agreement = new Agreement()
            {
                token = token
            };

            var executedAgreement = agreement.Execute(apiContext);
        }
コード例 #2
0
        public void AgreementExecuteTest()
        {
            var agreement = new Agreement()
            {
                token = "EC-2CD33889A9699491E"
            };
            var executedAgreement = agreement.Execute(TestingUtil.GetApiContext());

            Assert.AreEqual("I-ASXCM9U5MJJV", executedAgreement.id);
        }
コード例 #3
0
        public static void ExecuteBillingAgreement(string token)
        {
            // PayPal Authentication tokens
            var apiContext = PayPalConfiguration.GetAPIContext();

            var agreement = new Agreement()
            {
                token = token
            };
            var executedAgreement = agreement.Execute(apiContext);
        }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        private void ExecuteBillingAgreement(string token)
        {
            // Executing a payment
            var apiContext = Configuration.GetAPIContext();
            var agreement  = new Agreement()
            {
                token = token
            };
            var executedAgreement = agreement.Execute(apiContext);

            HttpContext.Current.Items.Add("ResponseJson", Common.FormatJsonString(executedAgreement.ConvertToJson()));
        }
コード例 #5
0
        public Agreement ExecuteBillingAgreement(string token)
        {
            // PayPal Authentication tokens
            var apiContext = GetAPIContext();

            var agreement = new Agreement()
            {
                token = token
            };
            var executedAgreement = agreement.Execute(apiContext);

            return(executedAgreement);
        }
コード例 #6
0
        public void AgreementGetTest()
        {
            var apiContext = TestingUtil.GetApiContext();
            var agreement  = new Agreement()
            {
                token = "EC-2CD33889A9699491E"
            };
            var executedAgreement  = agreement.Execute(apiContext);
            var agreementId        = executedAgreement.id;
            var retrievedAgreement = Agreement.Get(apiContext, agreementId);

            Assert.AreEqual(agreementId, retrievedAgreement.id);
            Assert.AreEqual("-6514356286402072739", retrievedAgreement.description);
            Assert.AreEqual("2015-02-19T08:00:00Z", retrievedAgreement.start_date);
            Assert.IsNotNull(retrievedAgreement.plan);
        }
コード例 #7
0
 public void AgreementExecuteTest()
 {
     try
     {
         var agreement = new Agreement()
         {
             token = "EC-2CD33889A9699491E"
         };
         var executedAgreement = agreement.Execute(TestingUtil.GetApiContext());
         Assert.AreEqual("I-ASXCM9U5MJJV", executedAgreement.id);
     }
     finally
     {
         TestingUtil.RecordConnectionDetails();
     }
 }
コード例 #8
0
 public void AgreementExecuteTest()
 {
     try
     {
         var agreement = new Agreement()
         {
             token = "EC-2CD33889A9699491E"
         };
         var executedAgreement = agreement.Execute(TestingUtil.GetApiContext());
         Assert.AreEqual("I-ASXCM9U5MJJV", executedAgreement.id);
     }
     catch (ConnectionException ex)
     {
         TestingUtil.WriteConnectionExceptionDetails(ex);
         throw;
     }
 }
コード例 #9
0
        public ActionResult Return(string token)
        {
            var subscription = _dbContext.Subscriptions.FirstOrDefault(x => x.PayPalAgreementToken == token);

            var apiContext = PayPalApiHelperService.GetApiContext();

            var agreement = new Agreement()
            {
                token = token
            };

            var executedAgreement = agreement.Execute(apiContext);

            // Save the PayPal agreement in our subscription so we can look it up later.
            subscription.PayPalAgreementId = executedAgreement.id;
            _dbContext.SaveChanges();

            return(RedirectToAction("Thankyou"));
        }
コード例 #10
0
        /// <summary>
        ///
        /// </summary>
        private void ExecuteBillingAgreement(APIContext apiContext, string token)
        {
            var agreement = new Agreement()
            {
                token = token
            };

            // ^ Ignore workflow code segment
            #region Track Workflow
            this.flow.AddNewRequest("Execute billing agreement", description: string.Format("URI: v1/payments/billing-agreements/{0}/agreement-execute", agreement.token));
            #endregion

            var executedAgreement = agreement.Execute(apiContext);

            // ^ Ignore workflow code segment
            #region Track Workflow
            this.flow.RecordResponse(executedAgreement);
            #endregion
        }