public void AgreementCancelTest() { var apiContext = TestingUtil.GetApiContext(); var agreementId = ""; var agreement = Agreement.Get(apiContext, agreementId); var agreementStateDescriptor = new AgreementStateDescriptor(); agreementStateDescriptor.note = "Canceling the agreement."; agreement.Cancel(apiContext, agreementStateDescriptor); var canceledAgreement = Agreement.Get(apiContext, agreementId); }
/// <summary> /// Cancel a billing agreement by passing the ID of the agreement to the request URI. In addition, pass an AgreementStateDescriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement. /// </summary> /// <param name="apiContext">APIContext used for the API call.</param> /// <param name="agreementId">ID of the billing agreement that will be canceled.</param> /// <param name="agreementStateDescriptor">AgreementStateDescriptor</param> public static void Cancel(APIContext apiContext, string agreementId, AgreementStateDescriptor agreementStateDescriptor) { // Validate the arguments to be used in the request ArgumentValidator.ValidateAndSetupAPIContext(apiContext); ArgumentValidator.Validate(agreementId, "agreementId"); ArgumentValidator.Validate(agreementStateDescriptor, "agreementStateDescriptor"); // Configure and send the request var pattern = "v1/payments/billing-agreements/{0}/cancel"; var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { agreementId }); PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.POST, resourcePath, agreementStateDescriptor.ConvertToJson()); }
public void AgreementSuspendTest() { var apiContext = TestingUtil.GetApiContext(); var agreementId = ""; var agreement = Agreement.Get(apiContext, agreementId); var agreementStateDescriptor = new AgreementStateDescriptor(); agreementStateDescriptor.note = "Suspending the agreement."; agreement.Suspend(apiContext, agreementStateDescriptor); var suspendedAgreement = Agreement.Get(apiContext, agreementId); }
public void AgreementReactivateTest() { var apiContext = TestingUtil.GetApiContext(); var agreementId = ""; var agreement = Agreement.Get(apiContext, agreementId); var agreementStateDescriptor = new AgreementStateDescriptor(); agreementStateDescriptor.note = "Re-activating the agreement."; agreement.ReActivate(apiContext, agreementStateDescriptor); var reactivatedAgreement = Agreement.Get(apiContext, agreementId); }
/// <summary> /// Bill an outstanding amount for an agreement by passing the ID of the agreement to the request URI. In addition, pass an AgreementStateDescriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement. /// </summary> /// <param name="apiContext">APIContext used for the API call.</param> /// <param name="agreementStateDescriptor">AgreementStateDescriptor</param> public void BillBalance(APIContext apiContext, AgreementStateDescriptor agreementStateDescriptor) { Agreement.BillBalance(apiContext, this.id, agreementStateDescriptor); }
/// <summary> /// Cancel a billing agreement by passing the ID of the agreement to the request URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement. /// </summary> /// <param name="apiContext">APIContext used for the API call.</param> /// <param name="agreementStateDescriptor">AgreementStateDescriptor</param> public void Cancel(APIContext apiContext, AgreementStateDescriptor agreementStateDescriptor) { Agreement.Cancel(apiContext, this.id, agreementStateDescriptor); }
/// <summary> /// Reactivate a suspended billing agreement by passing the ID of the agreement to the appropriate URI. In addition, pass an AgreementStateDescriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement. /// </summary> /// <param name="apiContext">APIContext used for the API call.</param> /// <param name="agreementStateDescriptor">AgreementStateDescriptor</param> public void ReActivate(APIContext apiContext, AgreementStateDescriptor agreementStateDescriptor) { Agreement.ReActivate(apiContext, this.id, agreementStateDescriptor); }
/// <summary> /// Suspend a particular billing agreement by passing the ID of the agreement to the request URI. /// </summary> /// <param name="apiContext">APIContext used for the API call.</param> /// <param name="agreementStateDescriptor">AgreementStateDescriptor</param> public void Suspend(APIContext apiContext, AgreementStateDescriptor agreementStateDescriptor) { Agreement.Suspend(apiContext, this.id, agreementStateDescriptor); }
/// <summary> /// Bill an outstanding amount for an agreement by passing the ID of the agreement to the request URI. In addition, pass an AgreementStateDescriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement. /// </summary> /// <param name="apiContext">APIContext used for the API call.</param> /// <param name="agreementId">ID of the billing agreement to perform the operation against.</param> /// <param name="agreementStateDescriptor">AgreementStateDescriptor</param> public static void BillBalance(APIContext apiContext, string agreementId, AgreementStateDescriptor agreementStateDescriptor) { // Validate the arguments to be used in the request ArgumentValidator.ValidateAndSetupAPIContext(apiContext); ArgumentValidator.Validate(agreementId, "agreementId"); ArgumentValidator.Validate(agreementStateDescriptor, "agreementStateDescriptor"); // Configure and send the request var pattern = "v1/payments/billing-agreements/{0}/bill-balance"; var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { agreementId }); PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.POST, resourcePath, agreementStateDescriptor.ConvertToJson()); }