#Aleeex

1 messages · Page 1 of 1 (latest)

dreamy valeBOT
lilac tulip
#

are you maybe passing payment_settings: {save_default_payment_method: 'on_subscription'}, when creating the Subscription?

#

that is what we recommend in our docs and it will do that(attach the card used as the default) since that's what is wanted in 90% of cases, but you could omit that parameter if it's not desirable

upper nexus
#

I had a look at the code and nope, we're not doing that unfortunately. I'm only using those parameters right now

      items: [{ price: priceID }],
      payment_behavior: paymentMean ? 'allow_incomplete' : 'default_incomplete',
      payment_settings: {
        payment_method_types: ['card', 'sepa_debit'],
      },
      expand: ['pending_setup_intent', 'latest_invoice', 'latest_invoice.payment_intent'],
);```
#

It's currently working well when the price is not free since we'll use a paymentIntent instead.

lilac tulip
#

maybe you have some code that manually sets the default_payment_method

#

for example you might be listening to a webhook somewhere and setting it(that is common to do)

#

if you had an example sub_xxx I could try having a look

upper nexus
#

as you can see it has been done "automatically" 🤷‍♂️

lilac tulip
#

interesting, I guess it just works this way and we automatically set the default payment method when confirming the pending_setup_intent in this case. I hadn't noticed it before specifically but it is the kind of thing that 90% of integrations would want

#

did you ever see it work differently?

#

ultimately the best option is to to manually update the value back I would think, which is a bit awkward to find the old ID unfortunately

upper nexus
#

as far as i know it has always been that way. We're currently trying to "break" the link between sub and PM but only use the user default payment method, and noticed we were still having this behaviour for free plans users. I guess you're right, maybe the only way is to update the sub once we confirm the setup intent.

#

However, it would be cool (really) to have a parameter on the setupIntent (or sub) to choose between the current behaviour and the one I'd like to have. I don't know if you can forward this to the product team but 😬

lilac tulip
#

I'll raise the feedback but it took years to get save_default_payment_method added so it's unlikely something will change in the short term. I'm a bit surprised it works this way(the SetupIntent flow apparently natively does save_default_payment_method and we had to deal with it being broken for 90% of integrations in the non-trial case) so will definitely mention it internally

upper nexus
#

could you give me a feedback if for any reason I were doing something wrongly?
Also, thanks for your help and I wish you good luck for the rest of your day! Awesome service as always

lilac tulip
#

I don't think you're doing something wrong, it's just unusual to not want the card that was just used to start the trial to be used the as the default for the future payments

#

I can see why(like you have an existing Customer with many cards), it's just not typical