#hans_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1286743915285975142
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- hans_best-practices, 23 hours ago, 25 messages
I'm confused because I am using the paymentIntents
const paymentIntent = await stripe.paymentIntents.create({
customer: 'cus_QsdHIYNAwg4YKC',
amount: 100,
currency: 'usd',
});
That customer has a payment method, but the payment is shown as incomplete
Hello! When you create the Checkout Session you can set subscription_data.billing_cycle_anchor to the desired anchor date for the Subscription: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-subscription_data-billing_cycle_anchor
Alternatively, you can add a free trial that ends at the end of the month.
You shouldn't be creating Payment Intents if you're using Checkout.
Or if you're using Subscriptions.
To clarify, you are asking about setting up a Subscription, correct?
Yeah, so you won't be creating Payment Intents directly.
Ah, okay, so you only want to use Checkout to collect payment info, not to start the Subscription?
Maybe, subscription in the Stripe sense is new to me so I don't know if it's appropraite or not
but we do need billing ahead of time, but charge at the end of the month
Let's back up a bit. Without worrying about anything Stripe-specific, tell me what you want to build at a high level. What's your ideal flow?
User signs up (or creates a new org) and must provide billing information. As they use resources through the month, we'll measure this and then charge the user at the end of the month. The user should be able to update their billing information.
Does your user pay anything up front, at the same time as they provide their payment info?
I could see where we may have a monthly fixed cost in the future, but for now it's only on usage and not charged if not used.
As the user is signing up, nothing is charged but we do want billing information.
Okay, so step one is to collect their payment info and details with Checkout in setup mode. This is the guide for that: https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=stripe-hosted
After that you'll have a Customer with a Payment Method attached to them you can use for the Subscription.
What is the difference between save-and-reuse vs https://docs.stripe.com/payments/save-during-payment?lang=node
Later, for step two, you can create a Subscription for that Customer using the options and timing you want. See here for more info: https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide?dashboard-or-api=api
How do I test a payment through a subscription?
The guide I linked to above is for collecting payment info without taking a payment at that time.
This page is for saving payment details while taking a payment at the same time, which isn't what you want to do: https://docs.stripe.com/payments/save-during-payment?lang=node
Everything I'm describing will work in test mode with our test cards.
Can I trigger a subscription to bill?
The guides walk you though building these things in test mode first.
Not sure I understand your question, can you provide more details?
Thanks. I'm in a sandbox (very nice) and using that to create customers and test our billing flow
I'm trying to prove to myself that I'm setting this up correctly
so, I want to prove that I can set up a subscription and see the bill work for a test customer
Okay, you probably want to use a Test Clock then, so you can advance time in test mode: https://docs.stripe.com/billing/testing/test-clocks
I set up the save-during-payment yesterday from advice and got stuck on actually billing a user, so I'm glad to get some more clarity on save-and-reuse
For the third part, managing already saved billing info, you can use the Customer Portal for that: https://docs.stripe.com/customer-management