Exemplo n.º 1
0
        /// <summary>
        /// Updates the release date of all disbursements of the advanced payment async.
        /// </summary>
        /// <param name="id">Advanced payment id.</param>
        /// <param name="releaseDate">The money release date.</param>
        /// <param name="requestOptions"><see cref="RequestOptions"/>.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>A task whose the result is the updated advanced payment.</returns>
        /// <exception cref="MercadoPagoException">If a unexpected exception occurs.</exception>
        /// <exception cref="MercadoPagoApiException">If the API returns a error.</exception>
        public Task <Resource.AdvancedPayment.AdvancedPayment> UpdateReleaseDateAsync(
            long id,
            DateTime releaseDate,
            RequestOptions requestOptions       = null,
            CancellationToken cancellationToken = default)
        {
            AdvancedPaymentUpdateReleaseDateRequest request = new AdvancedPaymentUpdateReleaseDateRequest
            {
                MoneyReleaseDate = releaseDate,
            };

            return(SendAsync(
                       $"/v1/advanced_payments/{id}/disburses",
                       HttpMethod.Post,
                       request,
                       requestOptions,
                       cancellationToken));
        }