Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        /// <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());
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 /// <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);
 }
Esempio n. 6
0
 /// <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);
 }
Esempio n. 7
0
 /// <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);
 }
Esempio n. 8
0
 /// <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);
 }
Esempio n. 9
0
        /// <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());
        }
Esempio n. 10
0
 /// <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);
 }
Esempio n. 11
0
 /// <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);
 }
Esempio n. 12
0
 /// <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);
 }
Esempio n. 13
0
 /// <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);
 }