#ironbeard_api

1 messages Β· Page 1 of 1 (latest)

cursive blazeBOT
#

πŸ‘‹ 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/1471528437599572132

πŸ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

analog root
#

Hi πŸ‘‹ taking a look

#

Do you happen to have the ID of the related Invoice object? I'm trying to pull it from the page but am not having luck so far.

analog root
#

Thank you, digging in

rapid ridge
#

(it's a different URL from the first one)

analog root
#

Oh weird, that second one at least has a recovery flow

rapid ridge
#

yeah, I saw that too

#

lemme try to find the id for the first one (Same customer)

analog root
#

I don't think I've seen this behavior before, but am looking for anything internally that may explain how this works.

rapid ridge
#

ID for the first one: in_1PaOooCoTIfwbn28XBiqtx3Z

analog root
rapid ridge
#

yeah, these are older invoices

#

okay, interesting. As an alternative, what I actually need is the "Pay online" URL in the invoice pdf. Is there a way for me to get that based on an invoice id / other fields?

#

(and does that expire?)

analog root
#

Wait, are we looking at the same fields πŸ˜… you mentioned invoice_pdf and I think I incorrectly read that as the hosted_invoice_url field which might be what you're looking for.

rapid ridge
#

Well, originally I was using invoice_pdf in an existing impl, I didn't realize hosted_invoice_url was a thing

#

but yes, I think you're right

analog root
#

Gotcha, haha my bad, I think we still got to where we needed to go though

rapid ridge
#

Great! πŸ™Œ

  1. do you know if this expires?
  2. if someone's subscriptional rewewal invoice doesn't finalize because their card expired, would hosted_invoice_url allow them to pay for the subscription's invoice in a way that would use the new card details the following period? (I don't really care if they're stored as separate PMs on stripe's end vs just updating the PM's exp date etc).
#

(just looked at hosted_invoice_url for the old invoice with the expired pdf, and it looks like it still works!)

analog root
#

They do expire, that's actually what the expiration limits I found earlier are referring to. The renewal Invoice should still finalize, but its payment will fail. I don't think the Hosted Invoice Page inherently sets up payment methods for future usage, but I would need to test to be sure.

#

Oh, just found another interesting tidbit about the PDF links:

While expired URLs normally redirect (302) to a recovery page, PDF download URLs are an exception. If Stripe detects that a non-browser client (for example, cURL) has requested PDF download URLs, we return a 400 error with a URL expired body response. This allows integrations to more easily detect when an invoice URL has expired, and to retrieve a new working URL by re-requesting the invoice or credit note resource.

rapid ridge
#

oh, interesting.

Well, I'm hoping to simplify my integration by allowing customers to pay open invoices through a link on their (self hosted) Orders page, which has a table of all their invoices. Generally, the self-hosted checkout flow uses a PaymentElement etc, but if something unexpected happens during checkout or if there's expired payment methods (off session), I was hoping to just direct customers to hosted_invoice_url. This way I don't have to bother with a page for customers to update their payment methods etc.

analog root
#

Oh, I looks like I suspected wrong here. I do see a new PM for my Customer after using the HIP to recover from an initially failed renewal payment. So that might be exactly what you're looking for.

rapid ridge
#

Thanks for checking that, I really need to learn how to use the time clocks and sandboxes better.

#

Did the PM get set as the Subscription's (or Customer's) default PM?

#

or set it up for future usage

analog root
#

Let me check

#

I don't see it set as the default anywhere

rapid ridge
#

hmm. bummer. But thanks for the help πŸ™‚

analog root
#

Any time!

rapid ridge
#

have a great day! πŸ‘‹