Ejemplo n.º 1
0
 /// <summary>
 /// Updates a preference.
 /// Just send in <paramref name="request"/> the properties you want to update.
 /// </summary>
 /// <param name="id">The preference ID.</param>
 /// <param name="request">The data to update a preference.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <returns>The updated preference.</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/preferences/_checkout_preferences/put/">here</a>.
 /// </remarks>
 public Resource.Preference.Preference Update(
     string id,
     PreferenceRequest request,
     RequestOptions requestOptions = null)
 {
     return(Send($"/checkout/preferences/{id}", HttpMethod.Put, request, requestOptions));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a preference as an asynchronous operation.
 /// </summary>
 /// <param name="request">The data to create a preference.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <param name="cancellationToken">Cancellation token</param>
 /// <returns>A task whose the result is the created preference.</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/preferences/_checkout_preferences/post/">here</a>.
 /// </remarks>
 public Task <Resource.Preference.Preference> CreateAsync(
     PreferenceRequest request,
     RequestOptions requestOptions       = null,
     CancellationToken cancellationToken = default)
 {
     return(SendAsync("/checkout/preferences", HttpMethod.Post, request, requestOptions, cancellationToken));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Updates a preference as an asynchronous operation.
 /// Just send in <paramref name="request"/> the properties you want to update.
 /// </summary>
 /// <param name="id">The preference ID.</param>
 /// <param name="request">The data to update a preference.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <param name="cancellationToken">Cancellation token</param>
 /// <returns>A task whose the result is the updated preference.</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/preferences/_checkout_preferences/put/">here</a>.
 /// </remarks>
 public Task <Resource.Preference.Preference> UpdateAsync(
     string id,
     PreferenceRequest request,
     RequestOptions requestOptions       = null,
     CancellationToken cancellationToken = default)
 {
     return(SendAsync($"/checkout/preferences/{id}", HttpMethod.Put, request, requestOptions, cancellationToken));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a preference.
 /// </summary>
 /// <param name="request">The data to create a preference.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/>.</param>
 /// <returns>The created preference.</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/preferences/_checkout_preferences/post/">here</a>.
 /// </remarks>
 public Resource.Preference.Preference Create(
     PreferenceRequest request,
     RequestOptions requestOptions = null)
 {
     return(Send("/checkout/preferences", HttpMethod.Post, request, requestOptions));
 }