#DramaLlama-PaymentMethod-Card
1 messages · Page 1 of 1 (latest)
What are you trying to do with the PaymentMethod? If you have the PaymentMethod object it typically makes more sense to use the PaymentMethod than the underlying Card
So I have a saas where we bill monthly after usage. So first invoice is after a month.
We allow the customer to input card at any point before the first invoice.
We used to use cards but I am making it sca compliant now, thus payment method
So yes, use the PaymentMethod
What happens with paymentMethods not attached to any customer?
Also apologies, I was confused. In this case there will not be a Card at all. The PaymentMethod is what you will use
But there is still a PaymentMethod.Card but I guess it's not the same thing fully
I think you need a Customer for a Subscription
So I create my custeomers and subscriptions before them entering their card (and thus me creating payment method).
So I use PaymentMethod/attach which seems to work fine.
But we have a simplified logic where we only allow one card for each customer. So I am thinking of detaching all existing payment methods before creating a new (when they update their card).
So just curious to what happens to the old PaymentMethods that are no longer attached to any customer
In what way are you still interested in them?
Just don't want them to trash around around interface anywhere... I alreadu hate that there is no way to delete invoice drafts and they just lay around and are visible in the dashboard
Ah so you are wondering if they will still be listed on the Customer?
Exactly, or somehow listed anywhere where they will bother me
as I will consider them past and deleted and I will no longer store a reference myself
Are you still seeing PaymentMethods that you detached or are you just basing this off of what you have seen with Invoices?
It's purely preemptive question.
If I were to do it this way, would they linger
I have not done my implementation yet
It will be removed from the UI
Fantastic!
But I have one more question about how to do this.
My plan was like this
- Customer signs up for our saas, lets say 1st of June. I then create a stripe customer and a subscription.
- One month later 1st of July this customer has his first payment coming up.
- On the 25th of June after a reminder he goes into his settings page in our platform and enters a card.
Now on the day when the customer browses to our settings, he fills in a card in a stripe elements card form, I then call CreatePaymentMethod and then does attach on this PaymentMethod to the customer. This part seems to work great.
So now I have a PaymentMethodId and said PaymentMethod is attached to the customer (great)
I now want to call confirmCardSetup that will take care of SCA verification if needed. But I see it needs a SETUP_INTENT_CLIENT_SECRET and I don't know where to get that in my scenario
I can answer, one sec
Awesome!
Maybe I myself found the method
-
Create my PaymentMethod like before
-
Create SetupIntent and set customer to my existing customer. and also set payment_method to my paymentMethod from step 1.
-
use confirmCardSetup as I now have both setup intent and payment method.
A question. If a customer has a valid payment method. Will it automatically be used by any monthly subscription or do I have to attach it manually?
so what you do is, instead of calling createPaymentMethod()
you collect a card "via" a SetupIntent
so for
- On the 25th of June after a reminder he goes into his settings page in our platform and enters a card.
you want to create a SetupIntent, confirm it with Elements withconfirmCardPayment(), that creates a PaymentMethod for you in one go
if you create a Customer, then a SetupIntent and pass customer: cus_123 on it, then when you do the rest steps above, that also auto-attaches the PaymentMethod to the Customer
basically this: https://stripe.com/docs/payments/save-and-reuse
ah cool, thanks!
And about PaymentMethod on a customer, will it be used by subscriptions even if not assigned?