Example #1
0
 public virtual async Task <IEnumerable <StripeCustomer> > ListAsync(StripeCustomerListOptions listOptions = null, StripeRequestOptions requestOptions = null, CancellationToken cancellationToken = default)
 {
     return(Mapper <StripeCustomer> .MapCollectionFromJson(
                await Requestor.GetStringAsync(this.ApplyAllParameters(listOptions, Urls.Customers, true),
                                               SetupRequestOptions(requestOptions),
                                               cancellationToken)
                ));
 }
 //Async
 public virtual async Task <StripeToken> CreateAsync(StripeTokenCreateOptions createOptions, StripeRequestOptions requestOptions = null, CancellationToken cancellationToken = default)
 {
     return(Mapper <StripeToken> .MapFromJson(
                await Requestor.PostStringAsync(this.ApplyAllParameters(createOptions, Urls.Tokens, false),
                                                SetupRequestOptions(requestOptions),
                                                cancellationToken)
                ));
 }
Example #3
0
 public virtual async Task <StripeCustomer> UpdateAsync(string customerId, StripeCustomerUpdateOptions updateOptions, StripeRequestOptions requestOptions = null, CancellationToken cancellationToken = default)
 {
     return(Mapper <StripeCustomer> .MapFromJson(
                await Requestor.PostStringAsync(this.ApplyAllParameters(updateOptions, $"{Urls.Customers}/{customerId}", false),
                                                SetupRequestOptions(requestOptions),
                                                cancellationToken)
                ));
 }