When creating a subscription with Stripe, automatically charge for the first month

I am using Stripe Asp.net C# to charge customers for subscriptions when they sign up. I have multiple products (created inside stripe) that I pull from to assign to that customer’s subscription. It successfully

  • Creates the customer
  • Assigns the subscriptions to the customer

The only thing that I am noticing is that it really does not charge the customer up front, it looks like it invoices the customer a $0.00 amount and carries over the subscription amount to the next bill which would be a month from the date created. For example if the customers subscription is $5.00 a month it will charge $0.00 and carry over the $5.00 to the next billing cycle which would make it a total of $10.00

I have tried to update the “BillingCycleAnchor” I have noticed through the errors that is has to be a future time stamp which I just added 2 minutes. This was unsuccessful as well below is the code that creates the subscription. Any help is appreciated.

if (numberOfUsersMinusBase > 0)
        {
            var items = new List<SubscriptionItemOptions>
                {
                    
                    //Subscription Price
                    new SubscriptionItemOptions
                    {
                        Price = "SubscriptionPriceId"

                    },
                    //Additional Users Subscription
                    new SubscriptionItemOptions
                    {
                        Price = "AdditionalUsersSubscriptionPriceId"
                        Quantity = numberOfUsersMinusBase,

                    },
                };
            var options = new SubscriptionCreateOptions
            {
                Customer = customer.Id,
                Items = items,
                BillingCycleAnchor = DateTime.Now.AddMinutes(2),
            };
            var service = new SubscriptionService();
            Subscription subscription = service.Create(options);
        }

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

It had something to do with the amount I was charging as a test. It looks like stripe automatically rolls over the amount until it hits the amount necessary for them to create a transaction. It says $.50, but I was doing $.80 maybe it is anything over the amount that they take such as the .30 per transaction plus the 1.9% of the transaction amount


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x