/// <summary> /// Captures a authorized advanced payment. /// </summary> /// <param name="id">Advanced payment id.</param> /// <param name="requestOptions"><see cref="RequestOptions"/>.</param> /// <returns>The captured advanced payment.</returns> /// <exception cref="MercadoPagoException">If a unexpected exception occurs.</exception> /// <exception cref="MercadoPagoApiException">If the API returns a error.</exception> public AdvancedPayment Capture( long id, RequestOptions requestOptions = null) { var request = new AdvancedPaymentCaptureRequest(); return(Send( $"/v1/advanced_payments/{id}", HttpMethod.PUT, request, requestOptions)); }
/// <summary> /// Captures a authorized advanced payment async. /// </summary> /// <param name="id">Advanced payment id.</param> /// <param name="requestOptions"><see cref="RequestOptions"/>.</param> /// <param name="cancellationToken">Cancellation token.</param> /// <returns>A task whose the result is the captured 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> CaptureAsync( long id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { var request = new AdvancedPaymentCaptureRequest(); return(SendAsync( $"/v1/advanced_payments/{id}", HttpMethod.PUT, request, requestOptions, cancellationToken)); }