コード例 #1
0
 // Sync
 public virtual StripeSubscriptionItem Create(StripeSubscriptionItemCreateOptions options, StripeRequestOptions requestOptions = null)
 {
     return(Post($"{Urls.BaseUrl}/subscription_items", requestOptions, options));
 }
コード例 #2
0
 // Async
 public virtual Task <StripeSubscriptionItem> CreateAsync(StripeSubscriptionItemCreateOptions options, StripeRequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(PostAsync($"{Urls.BaseUrl}/subscription_items", requestOptions, cancellationToken, options));
 }
コード例 #3
0
        public virtual StripeSubscriptionItem Create(string planId, string subscriptionId, StripeSubscriptionItemCreateOptions createOptions = null, StripeRequestOptions requestOptions = null)
        {
            var url = this.ApplyAllParameters(createOptions, Urls.SubscriptionItems, false);

            url = ParameterBuilder.ApplyParameterToUrl(url, "plan", planId);
            url = ParameterBuilder.ApplyParameterToUrl(url, "subscription", subscriptionId);

            return(Mapper <StripeSubscriptionItem> .MapFromJson(
                       Requestor.PostString(url, SetupRequestOptions(requestOptions))
                       ));
        }