Exemple #1
0
 /// <summary>
 /// Creates a Preapproval as an asynchronous operation.
 /// </summary>
 /// <param name="request">The data to create a Preapproval.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <param name="cancellationToken">Cancellation token.</param>
 /// <returns>A task whose the result is the created Preapproval.</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/subscriptions/_preapproval/post/">here</a>.
 /// </remarks>
 public Task <Preapproval> CreateAsync(
     PreapprovalCreateRequest request,
     RequestOptions requestOptions       = null,
     CancellationToken cancellationToken = default)
 {
     return(SendAsync("/preapproval", HttpMethod.POST, request, requestOptions, cancellationToken));
 }
Exemple #2
0
 /// <summary>
 /// Creates a Preapproval.
 /// </summary>
 /// <param name="request">The data to create a Preapproval.</param>
 /// <param name="requestOptions"><see cref="RequestOptions"/></param>
 /// <returns>The created Preapproval.</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/subscriptions/_preapproval/post/">here</a>.
 /// </remarks>
 public Preapproval Create(
     PreapprovalCreateRequest request,
     RequestOptions requestOptions = null)
 {
     return(Send("/preapproval", HttpMethod.POST, request, requestOptions));
 }