#tamires_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1245383425343623190
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
So that error means that you supplied some ID like tok_123 but tok_123 does not exist on your account. It might exist on another account that you own, but it does not exist on the account that you made the call on
Are you using Connect? It is common for this to happen if you make one call as one of your connected accounts but not the other
Oh, or it could be that tok_123 does exist but you gave the ID to an endpoint that only looks for another type of object ID. So like if you tried to retrieve a PaymentMethod called tok_123 you'd get that error because PaymentMethods only have IDs like pm_123
Are you using Connect
I don't think so, this came from creating a payment intent
Our syste has some legacy tokens that have the format of card_123 and new pm tokens like pm_123
both work for payment intent
but this one card_123 ended up not working as the param
Can you send me the request ID (req_123) where you got this error?
req_3RmfRHDm66MRAE
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Ah so that is the ID of a card on that customer but it looks like it got detached from the customer at the end of February. Figuring out how that happened
oh interesting!
Another question I have is: The documentation mentioned that if I create & confirm the payment request on the same call, that would attach the token to the customer under the hood. But I've been checking the data on stripe side and it doens't seem like it attaches the token to the client. It does attach it to the charge though.
Can you send me that doc? And are you also setting setup_future_usage on the PaymentIntent? As far as I am aware, that parameter should also be required if you want to save the PM to the Customer as part of the payment process
are you also setting setup_future_usage on the PaymentIntent
I am!
my code has setup_future_usage: "off_session",
And ah here we go, this happened because you updated the source property on this customer. If you add the source that way, it is expected that we will delete the old customer default PM. As the section mentions, you can use the token to create a card if you want to keep both
https://dashboard.stripe.com/logs/req_E5QFq0wR1atNxM
https://docs.stripe.com/api/customers/update#update_customer-source
When using payment sources created via the Token or Sources APIs, passing source will create a new source object, make it the new customer default source, and delete the old customer default if one exists. If you want to add additional sources instead of replacing the existing default, use the card creation API. Whenever you attach a card to a customer, Stripe will automatically validate the card.
Can you send me the ID of a payment intent like this that you confirmed but that didn't attach the PM? That should work as far as I am aware
this happened because you updated the source property on this customer.
oh that must have been before we started using pm where we would manually uupdate the customer.
let me take a look at some things on my end...
But that explanation will sufface about the error. Thanks.
Let me get a PI that is not attatching it to my customer
alright so this payment intent pi_3PLfK3KIWnXaN5iw0IzU843p for this customer cus_QC3Q7Ho9Q88moG.
We used a pm_123 token and it doesn't attach to the customer
As far as I can see, that PaymentMethod was successfully attached to that customer from that paymentintent confirmation. If you list payment methods for that customer, that payment method should come back as part of the list
https://docs.stripe.com/api/payment_methods/customer_list
Making a guess here, but that method of attachment does not automatically set the new PM as the Customer's default; is that what you were expecting that did not happen here?
If you list payment methods for that customer, that payment method should come back as part of the list
oh that is true I was able to retrieve it.
I think I was expecting the default. Is the default what shows on the customer.sources when I retrieve a customer?
There are two fields on a Customer object that define this: invoice_settings.default_payment_method and default_source, we prefer default_payment_method to default_source if both are set and if neither are set I think we don't consider there to be a default at all.
through which api?
Hello! I'm taking over and catching up...
The invoice_settings.default_payment_method is on the Customer. default_source is also on the Customer, but it's legacy and not recommended. There's also a default_payment_method on Subscriptions.
how would I set the PM as the customer's default through a payment intent then?
You can't. There's no concept of a default Payment Method at the Payment Intent level.
When confirming a Payment Intent with an associated Customer you need to specify both the Customer ID and the specific Payment Method ID you want to use to confirm.
I am aware, that's what we do. But if I wanna make sure that that would get attached as the default payment method to that customer what do I have to do?