/// <summary> /// Creates a advanced payment. /// </summary> /// <param name="request">The data to create the advanced payment.</param> /// <param name="requestOptions"><see cref="RequestOptions"/>.</param> /// <returns>The created advanced payment.</returns> /// <exception cref="MercadoPagoException">If a unexpected exception occurs.</exception> /// <exception cref="MercadoPagoApiException">If the API returns a error.</exception> /// <remarks> /// Check the API documentation /// <a href="https://www.mercadopago.com/developers/en/reference/advanced_payments/_advanced_payments/post/">here</a>. /// </remarks> public AdvancedPayment Create( AdvancedPaymentCreateRequest request, RequestOptions requestOptions = null) { return(Send( "/v1/advanced_payments", HttpMethod.POST, request, requestOptions)); }
/// <summary> /// Creates a advanced payment as an asynchronous operation. /// </summary> /// <param name="request">The data to create the advanced payment.</param> /// <param name="requestOptions"><see cref="RequestOptions"/></param> /// <param name="cancellationToken">Cancellation token</param> /// <returns>A task whose the result is the created advanced payment.</returns> /// <exception cref="MercadoPagoException">If a unexpected exception occurs.</exception> /// <exception cref="MercadoPagoApiException">If the API returns a error.</exception> /// <remarks> /// Check the API documentation /// <a href="https://www.mercadopago.com/developers/en/reference/advanced_payments/_advanced_payments/post/">here</a>. /// </remarks> public Task <AdvancedPayment> CreateAsync( AdvancedPaymentCreateRequest request, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { return(SendAsync( "/v1/advanced_payments", HttpMethod.POST, request, requestOptions, cancellationToken)); }