private async Task <Customer> getOrCreateCustomer(string email) { var service = new Stripe.CustomerService(); var listOptions = new Stripe.CustomerListOptions { Limit = 1 }; listOptions.AddExtraParam("email", email); var customer = (await service.ListAsync(listOptions)).Data.FirstOrDefault(); if (customer != null) { return(customer); } var customerCreateOptions = new Stripe.CustomerCreateOptions { Email = email }; return(await service.CreateAsync(customerCreateOptions)); }
public virtual IAsyncEnumerable <Customer> ListAutoPagingAsync(CustomerListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { return(this.ListEntitiesAutoPagingAsync(options, requestOptions, cancellationToken)); }
public virtual IEnumerable <Customer> ListAutoPaging(CustomerListOptions options = null, RequestOptions requestOptions = null) { return(this.ListEntitiesAutoPaging(options, requestOptions)); }
public virtual Task <StripeList <Customer> > ListAsync(CustomerListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { return(this.ListEntitiesAsync(options, requestOptions, cancellationToken)); }
public virtual StripeList <Customer> List(CustomerListOptions options = null, RequestOptions requestOptions = null) { return(this.ListEntities(options, requestOptions)); }