#lucasribeiro_

1 messages · Page 1 of 1 (latest)

neat cradleBOT
#

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.

twin lava
neon hemlock
#

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.

twin lava
#

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?

neon hemlock
#

No, I don't have a custom checkout. I'm using the default

#

I would like to add the fields to default checkout

twin lava
#

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

neon hemlock
#

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

twin lava
#

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?

neat cradleBOT
neon hemlock
#

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.

brisk forge
#

👋 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.

neon hemlock
#

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

brisk forge
#

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.

#

Then it will appear on the Invoices

neon hemlock
#

OK, maybe I'm expressing myself badly, how do I add (from the dashboard) the tax and address fields to the Hosted Invoice Page?

brisk forge
#

You can't do that

#

Only the payment method is collected via the Hosted Invoice Page

neon hemlock
#

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?

brisk forge
#

You can either collect it yourself up front, or you collect it via the Customer Portal, yes.

neon hemlock
#

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

brisk forge