Esempio n. 1
0
        /// <summary>
        /// Updates the release date of all disbursementes of the advanced payment.
        /// </summary>
        /// <param name="id">Advanced payment id.</param>
        /// <param name="disbursementId">Disbursement ID.</param>
        /// <param name="releaseDate">The money reelease date.</param>
        /// <param name="requestOptions"><see cref="RequestOptions"/>.</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 AdvancedPayment UpdateReleaseDate(
            long id,
            long disbursementId,
            DateTime releaseDate,
            RequestOptions requestOptions = null)
        {
            var request = new AdvancedPaymentUpdateReleaseDateRequest
            {
                MoneyReleaseDate = releaseDate,
            };

            return(Send(
                       $"/v1/advanced_payments/{id}/disbursements/{disbursementId}/disburses",
                       HttpMethod.POST,
                       request,
                       requestOptions));
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the release date of all disbursementes of the advanced payment async.
        /// </summary>
        /// <param name="id">Advanced payment id.</param>
        /// <param name="releaseDate">The money reelease 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 <AdvancedPayment> UpdateReleaseDateAsync(
            long id,
            DateTime releaseDate,
            RequestOptions requestOptions       = null,
            CancellationToken cancellationToken = default)
        {
            var request = new AdvancedPaymentUpdateReleaseDateRequest
            {
                MoneyReleaseDate = releaseDate,
            };

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