private void ExecuteBillingAgreement(APIContext apiContext, string token) { var agreement = new Agreement() { token = token }; var executedAgreement = agreement.Execute(apiContext); }
public void AgreementExecuteTest() { var agreement = new Agreement() { token = "EC-2CD33889A9699491E" }; var executedAgreement = agreement.Execute(TestingUtil.GetApiContext()); Assert.AreEqual("I-ASXCM9U5MJJV", executedAgreement.id); }
public static void ExecuteBillingAgreement(string token) { // PayPal Authentication tokens var apiContext = PayPalConfiguration.GetAPIContext(); var agreement = new Agreement() { token = token }; var executedAgreement = agreement.Execute(apiContext); }
/// <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())); }
public Agreement ExecuteBillingAgreement(string token) { // PayPal Authentication tokens var apiContext = GetAPIContext(); var agreement = new Agreement() { token = token }; var executedAgreement = agreement.Execute(apiContext); return(executedAgreement); }
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); }
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(); } }
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; } }
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")); }
/// <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 }