#jarrett-def-pm

1 messages · Page 1 of 1 (latest)

upper fable
surreal nova
#

i explicitly set the default_payment_method to nil

upper fable
#

if the Customer has a PaymentMethod in invoice_settings.default_payment_method then that IS used to pay the Subscription

how do you prevent the subscription from converting from trial to billing
the default PaymentMethod is unrelated to this, trial -> billing is entirely based on how the Subscription and its trial period is set up

#

so I think you might be confusing a couple of things, happy to clarify

#

how do you prevent the subscription from converting from trial to billing without them selecting a payment method.
mind rephrasing this in clear terms, will help me understand what you want to do and suggest accordingly

surreal nova
#

we have multiple products and a customer has defualt payment method on file. when the subscription trial ends we don't want them to automatically be billed without explicitly confirming by selecting a card for that.

upper fable
#

ok yeah that is different then

#

writing ...

#

so what you want for that is:

1/ don't set invoice_settings.default_payment_method on the Customer, otherwise it will be used as the default PaymentMethod for the Subscription

2/ create the Subscription with trial and also payment_behavior=default_incomplete

that will allow the Subscription to go into an incomplete state upon non payment

3/ you ask your customer for explicit confirmation, then you take their PaymentMethod of choice and use it to pay the Subscription's latest_invoice.payment_intent field

4/ once that succeeds, you use this new PaymentMethod and set it as default_payment_method on the Subscription to use it going forward

surreal nova
#

but the problem is we want the default payment method for other things. the customer may even have another subscription already

upper fable
#

so you should set default_payment_method on those Subscriptions as well and not on the Customer object

#

because then you cannot get the scenario you want

#

there are 2 fields here:

invoice_settings.default_payment_method on the Customer object -> means it will be used for ALL Subscriptions and Invoices

default_payment_method on the Subscription -> only used for that Subscription

surreal nova
#

if a customer has a subscription already but I unset their default payment method would that then work?

upper fable
#

I have to step away, a colleague is around to help out!

#

please do clarify what scenario you're referring ot here

surreal nova
#

a customer has a subscription in trial that was created with an invoice_settings.default_payment_method set. If i unset that, will the subscription still bill the default payment method that was set during creation?

stable breach
#

Hello! No, it won't, unless there's a default set on the Subscription itself.

surreal nova
#

No, it was explicitly set to nil. Just a thought... i figured default payment method on the customer just set the default payment method on the subscription. It would be nice if explicilty setting it to nil on the subscription took priority.

stable breach
#

It's the other way around. What are you trying to accomplish exactly?

#

Oh, I see, I just read this:

we have multiple products and a customer has defualt payment method on file. when the subscription trial ends we don't want them to automatically be billed without explicitly confirming by selecting a card for that.

If you want to make sure there's an explicit Payment Method selection for every Subscription you should set default_payment_method on the Subscriptions and leave invoice_settings.default_payment_method on the Customer empty.

surreal nova
#

i realized we already do that so it doesn't matter

#

and we always pass a PM through with all our one time purchases as well.

#

actually I realized it is a problem for us because besides subscriptions we have something called auto-refill which relies on a default payment method.

stable breach
#

Does your auto-refill system use Stripe Invoices?

surreal nova
#

yes

stable breach
#

Can you tell me how that works exactly?

surreal nova
#

a customer uses up all their credits and they have a configured amount of credits to purchase automatically.

#

we make an invoice and require they have a default payment method set

#

the only thing I can think to do is kinda dumb and that is to set a field on the customer called default_payment_method in the metadata and store it there and then use that in our calls specifically. but that really isn't ideal because it's confusing and doesn't allw the change to be made from the stripe panel by a non technical person

stable breach
#

However, that last part about non-technical people needing to make the change from the Stripe Dashboard puts a wrinkle in things... 🤔

surreal nova
#

the system would be so much more flexible if default payment method trickled down onto subs and invoices but an explicit setting of nil would take priority.

stable breach
#

To confirm one detail, the non-technical folks you mentioned are only interacting with the Stripe Dashboard, not any kind of UI or interface you build/have control over?

surreal nova
#

as of now yes

#

i'd really like to not have to roll our own default payment method controls

stable breach
#

I think you may have to in order to support the use case you describe. invoice_settings.default_payment_method on Customers in Stripe is designed to be the default for all Invoice payments for that Customer, so if you set it, it'll be used unless a default on the Subscription/Invoice overrides it.

surreal nova
#

ugh 😦

stable breach
#

Would it be possible to ask your customers to designate a default Payment Method up front for the auto-refill system and also indicate it will be used by default for Subscriptions unless another is selected?

surreal nova
#

it's more about the fact that starting a trial is not abundantly clear that it will convert

#

usually people expect to have to enter a card or select one or something when there trial is over

#

but the way things currently are the trial will convert because a valid payment method will be on file

#

additionally, even though I can roll my own to accomplish a workaround of some sort... it leaves the table open for bugs and what not. if someone doesn't realize and sets a card as the default on a customer it would cause the same problem.

stable breach
#

That brings me back to suggesting you leave the Customer's default empty, but you mentioned someone else setting the default... are you talking about through the Dashboard or via code?

surreal nova
#

dashboard

stable breach
#

One thing that comes to mind is you could listen to customer.updated events to see if a default is ever set on the Customer, then remove it if you never want one.

surreal nova
#

i suppose that's a decent fail safe

#

feels like this is a patch job though lol

stable breach
#

Yeah, it kinda is, but it should work. The main issue is that you're kinda working against the grain of how Stripe works, so you're going to run into situations like this that require creative workarounds.

surreal nova
#

I guess, it just seems odd to me that you can set an option on subscriptions but it doesn't override the null option. Explictly setting something makes sense to me.

stable breach
#

Yeah, the way Stripe works is the default_payment_method on the Subscription takes priority if it's set. If it's not set we fall back to the default set on the Customer.