#Coach Leyton

1 messages · Page 1 of 1 (latest)

undone gulchBOT
turbid pasture
#

Can you share the customer ID (cus_xxx) that you attempt to update the payment method to 4000000000000341?

prisma orbit
#

Sure, it's cus_O1UQmOhkA5G33i

turbid pasture
#

How did you update the payment method?

#

Did you update the payment method on the subscription section or the payment method section in customer portal?

prisma orbit
#

I generated a link to the portal, as seen here:

I then added the payment method on the "payment methods" section in the portal:

#

That is to say, I didn't update the subscription directly

turbid pasture
#

The subscription will use the default payment method set on the customer's invoice_settings.default_payment_method

#

It's not specific to 4000000000000341 only. Any test card updated in payment method section will result in the same behaviour

#

For example
pm_1NFRZaHxbsbtU2J3W6gEDJ4t using 6011000990139424, it only updated the customer's invoice_settings.default_payment_method and didn't update the subscription's default_payment_method

prisma orbit
#

As far as I'm aware, Subscriptions will use the default payment method set in invoice_settings.default_payment_method UNLESS there is a defaultPaymentMethodId set directly on the subscription. Is this correct?

turbid pasture
#

Yes correct. By setting payment method as default in customer portal (the screenshot you shared), it will unset the subscription's default_payment_method and use customer's invoice_settings.default_payment_method

#

Which is why you saw subscription's default_payment_method setting to null

#

As long as customer update default payment method in the customer portal, all the subscriptions will reference to the newly added one set on the customer and remove the existing default_payment_method set directly on the subscription

prisma orbit
#

So it isn't necessarily the addition of a payment method that is resetting the subscriptions defaultPaymentMethodId to null, but instead it's the setting of any payment method as "default" that does that?

turbid pasture
#

The system will set subscription's default_payment_method to null, so that it will charge to customer's invoice_settings.default_payment_method if the default payment method is added through customer portal

#

Yup! Setting the payment method default will make the subscription default_payment_method to null

prisma orbit
#

Okay, so. After this issue, the default_payment_method_id on my subscription was null, and so I manually set it to the 4242 visa card, as shown here:

#

Then, I entered the customer billing portal, and added a new card (Diners Club), and set is as the default on my customer

#

This is reflected in the UI of my website:

#

so I know that change was definitely made

#

however

#

the default_payment_method_id on the subscription has NOT been reset:

#

it remains as the 4242 card

#

This seems contrary to the information you gave me, when you mentioned that the default_payment_method_id of the subscription would be reset

#

maybe I'm missing something

#

also, I'm currently trying to reproduce the issue, by either setting the default payment method of my invoice settings to the 0341 test card, or removing it and adding it again as the default payment method, and this time I'm unable to reproduce the issue (the default_payment_method_id of my subscription is not reset).

I seem to only be able to reproduce this resetting of the default_payment_method_id when I've just created the customer. Although, this inability to reproduce the issue reliably may just be an issue on my end.

turbid pasture
#

Thanks for sharing! I'm able to reproduce that the subscription default_payment_method isn't unset when updating the customer's invoice_settings.default_payment_method

#

Unsetting behaviour will only happen on the newly created subscription

prisma orbit
#

Ahhh

#

okay, thought I was going crazy

#

Is there any way to prevent this unsetting behaviour?

turbid pasture
#

Since customer portal is used, it's not possible to control the behaviour of it. I'd suggest writing to Stripe Support https://support.stripe.com/contact with customer ID and steps that to reproduce the behaviour, so that they can check with relevant team.

prisma orbit
#

Well that's a shame, but thank you very much for your help, I really appreciate it.

I plan to continue using the billing portal, seen as it saves me the effort of implementing some functionality manually and providing a UI for it.

When writing to support, is the customer ID relevant? Couldn't this be reproduced with any customer? I ask this because I plan to delete that customer relatively soon. I'm doing a lot of testing to make sure all my payment stuff is working fine, and I like a clean workspace.

turbid pasture
#

It can be produced by any customer. Sharing the customer ID (cus_xxx) will be helpful for the team to reproduce the behaviour and understand the issue better

#

I'd recommend having a clean customer with this issue only (without other testing) and keeping it as it is. You may still perform testings on other customer