#lucasribeiro_
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- lucasribeiro_, 2 days ago, 11 messages
- lucasribeiro_, 5 days ago, 25 messages
Hi there 👋 sounds like you're looking at using the post-payment Invoice creation feature of Checkout Sessions?
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-invoice_creation-enabled
What information are you not seeing on the resulting Invoice so far in your testing?
Enabling Tax ID collection is discussed here:
https://stripe.com/docs/tax/checkout/tax-ids#create-session
Collecting phone numbers here:
https://stripe.com/docs/payments/checkout/phone-numbers
no, I am directly creating a free trial, and then he will pay, but yes, it is a recurring charge.
here is how im creating:
const customer = await stripe.customers.create({
email: userEmail,
metadata: {
id: companyId
}
})
const startTrial = await stripe.subscriptions.create({
customer: stripeCustomerID,
items: [
{
//PRICEID DE PRODUÇÃO
price: 'xxx'
quantity: 1
},
],
trial_period_days: 7,
});
so I would like to add these fields such as tax id, address and telephone number when the customer pays.
Oh, so you have your own checkout page of some sort then? And you're trying to figure out how to get the data from that to the correct objects in Stripe?
No, I don't have a custom checkout. I'm using the default
I would like to add the fields to default checkout
Alright, so you shouldn't be directly creating Subscriptions then if you're intending to the let the Checkout Session do it.
I'd recommend starting here, with our guide for using Checkout Sessions to create Subscriptions:
https://stripe.com/docs/billing/subscriptions/build-subscriptions
then check the resulting Invoice to see what else you want to have collected that isn't by default
I'm creating directly because I don't would like to collect the payment methods when user register.
And anyway, I don't would like to add one more step during the register
Sorry, I'm very confused, I don't understand how you want to use Checkout Sessions to collect details, while also not using the Checkout Session to create a Subscription. Maybe let's take a step back? What is the flow you're trying to build?
OK, sorry if I wasn't clear hehe
The flow is as follows: I have a registration form in my app where I basically ask for email and password, and then I would like the trial period to start counting from there.
When the trial period ends we have two options, either the customer adds the payment method through the Stripe customer portal, or they can pay directly the invoice that is created.
👋 stepping in
Okay so with that description you wouldn't use Stripe Checkout at all since you aren't collecting the PaymentMethod when the trial starts.
so, during this payment via invoice, the standard checkout is used, right? I would like to request that data here. and select whether they are mandatory or not
To pay a Subscription's Invoice you can either use the Customer Portal/Hosted Invoice Page or you own custom payment flow -- you can't use Stripe Checkout to pay an already-created Invoice.
In terms of including the tax info you are referencing on the Invoices, you want to update the Customer's invoice_settings.custom_fields (https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-custom_fields) with this information
Then it will appear on the Invoices
OK, maybe I'm expressing myself badly, how do I add (from the dashboard) the tax and address fields to the Hosted Invoice Page?
Hmm, I understand. So is there any other way to collect it, or in this case would it be better just through the customer portal?
You can either collect it yourself up front, or you collect it via the Customer Portal, yes.
Right, is there any object inside customer that I could check to see if they have already been filled in? via api. So who knows, maybe I can display a warning during the app that has not yet been filled in on the portal
Best thing to do is to test this stuff out, but if they add a Tax ID then yes it would be within the tax_ids property: https://stripe.com/docs/api/customers/object#customer_object-tax_ids