Base object for all financial value related fields (balance, payment due, etc.)

See PayPal Developer documentation for more information.

Inheritance: PayPalSerializableObject
Beispiel #1
0
        /// <summary>
        /// Set the balance for an agreement by passing the ID of the agreement to the request URI. In addition, pass a Currency object in the request JSON that specifies the currency type and value of the balance.
        /// </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="currency">Currency</param>
        public static void SetBalance(APIContext apiContext, string agreementId, Currency currency)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(agreementId, "agreementId");
            ArgumentValidator.Validate(currency, "currency");

            // Configure and send the request
            var pattern = "v1/payments/billing-agreements/{0}/set-balance";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { agreementId });
            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.POST, resourcePath, currency.ConvertToJson());
        }
Beispiel #2
0
 /// <summary>
 /// Set the balance for an agreement by passing the ID of the agreement to the request URI. In addition, pass a Currency object in the request JSON that specifies the currency type and value of the balance.
 /// </summary>
 /// <param name="apiContext">APIContext used for the API call.</param>
 /// <param name="currency">Currency</param>
 public void SetBalance(APIContext apiContext, Currency currency)
 {
     Agreement.SetBalance(apiContext, this.id, currency);
 }