示例#1
0
 /// <summary>
 /// Creates a card for customer.
 /// </summary>
 /// <param name="customerId">Customer ID.</param>
 /// <param name="request">Request to create the card.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <returns>The created card.</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/cards/_customers_customer_id_cards/post/">here</a>.
 /// </remarks>
 public CustomerCard CreateCard(
     string customerId,
     CustomerCardCreateRequest request,
     RequestOptions requestOptions = null)
 {
     return(cardClient.Create(customerId, request, requestOptions));
 }
示例#2
0
 /// <summary>
 /// Creates a card for customer as an asynchronous operation.
 /// </summary>
 /// <param name="id">Customer ID.</param>
 /// <param name="request">Request to create the card.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <param name="cancellationToken">Cancellation token</param>
 /// <returns>A task whose the result is the created card.</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/cards/_customers_customer_id_cards/post/">here</a>.
 /// </remarks>
 public Task <CustomerCard> CreateCardAsync(
     string id,
     CustomerCardCreateRequest request,
     RequestOptions requestOptions       = null,
     CancellationToken cancellationToken = default)
 {
     return(cardClient.CreateAsync(id, request, requestOptions, cancellationToken));
 }
示例#3
0
 /// <summary>
 /// Creates a card for customer.
 /// </summary>
 /// <param name="customerId">Customer ID.</param>
 /// <param name="request">Request to create the card.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <returns>The created card.</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/cards/_customers_customer_id_cards/post/">here</a>.
 /// </remarks>
 public CustomerCard Create(
     string customerId,
     CustomerCardCreateRequest request,
     RequestOptions requestOptions = null)
 {
     return(Send(
                $"/v1/customers/{customerId}/cards",
                HttpMethod.POST,
                request,
                requestOptions));
 }
示例#4
0
 /// <summary>
 /// Creates a card for customer as an asynchronous operation.
 /// </summary>
 /// <param name="customerId">Customer ID.</param>
 /// <param name="request">Request to create the card.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <param name="cancellationToken">Cancellation token</param>
 /// <returns>A task whose the result is the created card.</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/cards/_customers_customer_id_cards/post/">here</a>.
 /// </remarks>
 public Task <CustomerCard> CreateAsync(
     string customerId,
     CustomerCardCreateRequest request,
     RequestOptions requestOptions       = null,
     CancellationToken cancellationToken = default)
 {
     return(SendAsync(
                $"/v1/customers/{customerId}/cards",
                HttpMethod.POST,
                request,
                requestOptions,
                cancellationToken));
 }