#mattwoberts-setup-intents

1 messages · Page 1 of 1 (latest)

modern mantle
#
  1. Yes, assuming you passed the customer parameter when creating the Setup Intent.
  2. return_url is only really useful for that method if you're handling next actions yourself (not recommended).
compact dragon
#

Right, thanks for this, that makes sense

#

If it's attached to the customer, will it then be used for future subscription payments, or does it need to be attached to the subscription?

modern mantle
#

You'd need to set the PM as the default on either the customer or the subscription. Simply saving/attaching to the customer is not enough.

I'd recommend just using this parameter on subscription creation: https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method

#

Out of interest, are you using a Setup Intent and then creating a Subscription?

compact dragon
#

I was - that's what the code does now. But I'm changing it so that I create a subscription, and then create a setupintent after that

modern mantle
#

Why do you need to do that? The subscription creation flow will handle the setup of the payment method

compact dragon
#

Because in our app, we start a sub with a free trial, and then during that trial users can enter a card - which we handle as a setup intent.

modern mantle
#

The subscription with the free trial will likely create and return a Setup Intent for you

compact dragon
#

Hmm, I didn't know that, but I did read that setup intents are pretty short lived, and you shouldn't keep them hanging around... so you think I can use that setup intent for card entry, even say 20 days into the trial:?

modern mantle
#

AFAIK, they aren't short lived

compact dragon
#

Ah OK cool I'll test that.

#

One final question if you don't mind - I've just updated the .net SDK version we're using, and we've got some code that reads the subscription plan id : "mySub.Plan.Id"

#

I see though that that has been removed, the subscription object no longer has it's plan.. How do I get the plan id now?

modern mantle
#

Which version?

compact dragon
#

I think I was on 29, it's moved into 40 now

#

(Not updated for about a year)

modern mantle
compact dragon
#

😬

modern mantle
#

The .NET SDK is tightly coupled with the API version

compact dragon
#

OK thanks, this is going to take some careful poking around 😉

patent plover
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!