#maxime_docs
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/1239533970647941231
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! the order is
invoice.default_payment_method
invoice.default_source
subscription.default_payment_method
subscription.default_source
customer.invoice_settings.default_payment_method
customer.default_source
i.e the more specific object (invoice->subscription->customer) and prefer PaymentMethod to legacy objects
Hi, thanks for the reply. I have one more question on this, give me 1s
-
- When you say "prefer PaymentMethod to legacy objects", I'm guessing that the
default_sourceare the legacy objects?
- When you say "prefer PaymentMethod to legacy objects", I'm guessing that the
-
- Are there others than the ones above? Or did I cover everything?
-
- Can the
PaymentMethodobjects be set as well as the legacy objects? Or it'll always be either one or the other? And setting one would mark the associated other to null?
- Can the
1/ yes /2 seems complete 3/ you can have both set, and as mentioned payment_method fields will be preferred when we're checking what to actually charge for a given invoice
Can this interfere somehow? https://docs.stripe.com/api/invoices/object#invoice_object-payment_settings
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
not speciically in choosing what method we'll charge. Really depends what the real question or problem you're trying to solve is here.
the simple answer here is if you follow the integration guides, they all set subscription.default_payment_method to the method used to pay the first invoice on-session when you create the subscription, and you don't generally need to think much about the other fields
I'm trying to build a UI where I'll show the user all the payment methods they've got and let them choose which one to use.
And there are multiple sources where this info can come from, I'm really just trying to make sure that I take them all into account to know for the current subscription which one it'll be
makes sense,it's just that assuming this is a new integration you're building today on a Stripe account recently created, you'll never interact with default_source fields so those can be ignored at least
I think I've seen a few times this field set. Not sure but I'm guessing it was coming from the fact that the data can be tweaked by an admin or maybe from the customer portal that we've activated
And what happens in the case where a user wants to pay through an invoice instead of the charge automatically method?
Is it even possible? Can the user mark to use a card by default when paying using invoice instead of charge automatically?
Or will it always be on hold for an invoice and it'll required some manual user input to pay an invoice? ๐ค
if you mean an invoice with collection_method:"send_invoice" , the customer just enters some payment details on the hosted invoice page and that is what is used to pay, it's not connected to these fields we're discussing
Yes that's what I meant ๐
Cool yeah I just wanted to clarify this as invoice.default_payment_method sound like it may have an impact on collection_method: "send_invoice" but I guess it's 2 different things really here
Thanks a lot for your help!
Oh actually sorry
Is there any view like the customer portal to manage the payment methods for the current user?
I know that there's one to add a new payment, but I couldn't find one to manage the payment only.
There's also the customer portal itself where that's possible but it's possible to manage all the subscriptions as well, I'd like a page to only manage the payment methods. But I'm not sure there's a Stripe UI for this, is there?
I'm using this code to add a payment:
SessionCreateParams.builder()
.setCustomer(stripeCustomerId)
.setFlowData(
SessionCreateParams.FlowData.builder()
.setType(SessionCreateParams.FlowData.Type.PAYMENT_METHOD_UPDATE)
.setAfterCompletion(
SessionCreateParams
.FlowData
.AfterCompletion
.builder()
.setType(SessionCreateParams.FlowData.AfterCompletion.Type.REDIRECT)
.setRedirect(
SessionCreateParams
.FlowData
.AfterCompletion
.Redirect
.builder()
.setReturnUrl(request.returnUrl)
.build()
)
.build()
)
.build()
)
.build()
But not sure there's a way to generate a portal to manage payments?
Because while this says SessionCreateParams.FlowData.Type.PAYMENT_METHOD_UPDATE it's actually only offering a UI to add a new payment method
the deep link to the CustomerPortal like that is the only option today but we have some products in the works for this
Ok, thanks! And glad to hear ๐
I'm happy for you to mark this thread as resolved โ Thanks a lot for the help
Actually... If you're still around ๐
I'm not sure I get the idea of the invoice settings. Is it something a customer can set themselves?
I'd have thought that only the default payment (customer default source) and subscription one (both deprecated and new one) make sense.
But the invoice one, knowing that it's not used when using collection_method:"send_invoice", what's the point of this?
Changing the source for a specific invoice, and next cycle unless changed again, it'd use the one specified at the invoice level?
But is something that the customer can change anywhere? Or can only an admin do that?
maybe you want one specific invoice to use a specific payment method different from the usual default. You as the merchant can set it in the API or Dashboard.