#asittingduck_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/1297964544164888719
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
Do you have an example Invoice ID I could review?
I might, give me a moment, I am not certain it will have one because it won't create the invoice, but I mightr have a call id
the Request ID is
req_Kx4EH6xhlkRJfu
Taking a look at the request.
thanks
Ah, you are using the /pay API. That is only for invoices with a specified payment method. If you want to trigger sending the Invoice email, you need to use the Send API: https://docs.stripe.com/api/invoices/send
Didn't see that in the docs.... somehow
Thanks for that
I am voiding those invoics and letting the customers know what happened because they were expecting to auto charge... on a related note, if customer clicks "save payment for future transactions" on a payment link, why isn't that labeled as the default payment method?
We automatically set the saved PM as the default for invoices if the payment method is saved as part of the initial payment for a subscription. Otherwise it is up to your code to set the new payment method as default for the customer.
That is the case for these customers but my system is saying they don't have a default payment method.
For example
cus_QpcqLAPuI6V5yO
Do you see an issue with how I am looking for the payment method here that would prevent that from happening?
I see a payment_method.attached event for the customer that shows the payment method was attached but it does not appear to be set as the Invoice default
exactly, why is that?
๐ stepping in here
Nice thanks. sorry for that delay on responding to the last message
No worries.
It does look like that Subscription has the PaymentMethod that was initially used set as the default as expected. You can see that here: https://dashboard.stripe.com/subscriptions/sub_1PxxaqIlmlJhoaqYfrHoRHsQ
However, that PaymentMethod is set as the default for the Subscription, not the Customer. If you want to use the /pay endpoint without passing the PaymentMethod ID then it would have to be set at the Customer level via invoice_settings.default_payment_method
Ok but how can we make payment links set a payment method the default payment method for a customer?
You would have to build that yourself using Webhooks. So after the Checkout Session was completed you would update the Customer using: https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
Glad to hear it!