#evan_09475

1 messages · Page 1 of 1 (latest)

lime marshBOT
jagged pier
#

Hello! That's expected behavior - when a Subscription is trialing there's no payment due, so there's no reason to create a Payment Intent.

Instead, you can grab a Setup Intent from pending_setup_intent on the Subscription and use it to collect pamynet details

broken jackal
#

this is the object am passing to the create method

  let subscriptionData = {
      customer: paymentObj.providerCustomer.stripeCustomerId,
      items: [
        {
          plan: stripePlanId
        }
      ],
      payment_behavior: 'default_incomplete',
      payment_settings: { save_default_payment_method: 'on_subscription' },
      expand: ['latest_invoice.payment_intent']
    }

#

I need to change to this I beleieve

  expand: ['latest_invoice.payment_intent', 'pending_setup_intent'],
jagged pier
#

Yup! That way you'll get the full Setup Intent expanded and can get the client secret

lime marshBOT
broken jackal
#

the fullset up payment intent is having status: 'requires_payment_method', although I have already passed paymentMethod when creating the subscription and the customer

#

Is that normal?

prime rock
#

Hi can you share the payment intent id?

broken jackal
#

seti_1No9nFD9sYh65PYtvWYuroxc

prime rock
#

Oh that's a setupintent

#

Also payment method was never provided. That's why

#

That setupintent is to collect payment method data for the subscription. But, if your customer already has a default payment method attached, then you shouldn't need to do that step

#

Their default pm will be charged once the trial is over

#

Although the customer you provided doesn't have a default payment method set, so the first subscription payment will fail

broken jackal
#

but am passing the paymentMethod when I create the customer

#
    const response = await this.stripeGateway.customers.create({
      email: user.email,
      name: paymentObj.payeeName,
      payment_method: paymentObj.paymentMethod,
      metadata: { zendyUserId: user.id, zendy: 'Zendy OA' }
    })


prime rock
#

Yeah that doesn't matter though. Subscriptions only charge the payment method set as default

#

You can have many payment methods on a customer

#

So you need to set a default

broken jackal
#

Okay so you mean when I create a customer I have to pass

invoice_settings : {
default_payment_method: id of the payment method
}

prime rock
#

Yeah that would be how to set the pm as the customer's default

broken jackal
#

They will behave the same right?

prime rock
#

Yes, but if it's set on the subscription level, that overrides/takes precedence over the one set on the customer

broken jackal
#

When Passing the default_payment_method to the customer the status of the setup payment intent is status: 'requires_confirmation'

#

that is the id of the set up intent
seti_1NoAFQD9sYh65PYtDVghb6mr

prime rock
#

Yeah that's unrelated

#

The point of that setupintent is to give you an opportunity to collect new payment details

#

Which you don't do

#

Every sub with a trial creates a setupintent

broken jackal
#

the code earlier I provided was confirming the paymentIntent.

In my case, when I do a trial subscription, Do I have to confirm the setupIntent

prime rock
#

No not necessary