#Carlos Mascarenhas - Default Payment Method

1 messages · Page 1 of 1 (latest)

vale tusk
#

We don't change the default PM to the one used in the payment because that might not necessarily be what you want

#

You have to explicitly set the payment method to be the customer's default if you want it as that

haughty minnow
#

Use stripe.confirmCardPayment when the customer submits your payment form. When called, it will confirm the PaymentIntent with data you provide and carry out 3DS or other next actions if they are required.
If you are using Dynamic 3D Secure, stripe.confirmCardPayment will trigger your Radar rules to execute and may open a dialog for your customer to authenticate their payment.
When you confirm a PaymentIntent, it needs to have an attached PaymentMethod. In addition to confirming the PaymentIntent, this method can automatically create and attach a new PaymentMethod for you. It can also be called with an existing PaymentMethod, or if you have already attached a PaymentMethod you can call this method without needing to provide any additional data. These use cases are detailed in the sections that follow.

#

the documentation says that this method can automatically create and attach a payment method to the customer, in my case this is not happening.

vale tusk
#

Attaching a payment method to a customer and setting it as the customer's default are different. The payment method must first be attached to the customer before it is set as the default. You are not even seeing a payment method being attached to your customer?

haughty minnow
#

So the confirmCardPayment library attaches a payment method to the customer but I didn't set it as default?

alpine perch
tardy tinsel
haughty minnow
#

I got confused now

#

Can you explain better what the confirmCardPayment library does besides confirming a payment intent?

tardy tinsel
#

It just confirms a payment intent

haughty minnow
#

I will try to explain my subscription creation flow

tardy tinsel
#

ah so you do use Subscriptions!

haughty minnow
#

First I create a customer just by entering personal data, without collecting payment information.

Then I create a subscription with a default status of incomplete.

after that I collect the payment data and confirm it using the confirmCardPayment library

#

In a situation of monthly subscription renewal, would the customer have to insert a credit card again?

tardy tinsel
#

all good I got it

#

We know it's not great and our engineering team is literally working on trying to fix this this week. It will take a few weeks/months to ship but hopefully that will make integrations easier in the future

haughty minnow
#

What happens if I don't set a default payment method?

#

I passed this parameter as off_session and set it as default

tardy tinsel
#

I'm sorry you're overthinking this a little bit

haughty minnow
tardy tinsel
#

you shouldn't have to pass anything

#

But really all you need to do is after the PaymentMethod is attached successfully, make it the default, either on the Customer or on the Subscription, so that future invoices are paid with that card

haughty minnow
#

does setting setup_future_usage to off_session solve my problem?

tardy tinsel
#

not at all

#

it's completely unrelated

#

that's the guide you need to follow end to end

haughty minnow
#

ok

#

thanks

tardy tinsel
#

sure! and I do agree it's annoying that's why we want to fix it

#

If you have a customer id after you make the code change I can have a look to confirm it works

haughty minnow
#

How do you intend to resolve this?

tardy tinsel
#

We're planning to do exactly what you thought would happen earlier: when you successfully confirm the PaymentIntent of a Subscription, that PaymentMethod becomes the default for that Subscription automatically

#

Does that make sense?

haughty minnow
#

Yes

#

looking forward to the update