#maxime_docs

1 messages ยท Page 1 of 1 (latest)

gusty mangoBOT
#

๐Ÿ‘‹ 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.

slender slateBOT
edgy turtle
#

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

spice stream
#

Hi, thanks for the reply. I have one more question on this, give me 1s

#
    1. When you say "prefer PaymentMethod to legacy objects", I'm guessing that the default_source are the legacy objects?
    1. Are there others than the ones above? Or did I cover everything?
    1. Can the PaymentMethod objects 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?
edgy turtle
#

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

spice stream
edgy turtle
#

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

spice stream
#

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

edgy turtle
#

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

spice stream
#

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? ๐Ÿค”

edgy turtle
#

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

spice stream
#

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

edgy turtle
#

the deep link to the CustomerPortal like that is the only option today but we have some products in the works for this

spice stream
#

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?

edgy turtle
#

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.