#quest1515

1 messages · Page 1 of 1 (latest)

untold cedarBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

mild vector
#

hi @spare glade ! just to follow up on the last thread, are you a developer writing the code here for these 'payment links' and creating Invoices?

#

ah you're using PaymentLinks

#

then i don't really understand the issue. Do you have an example I can look at like a failed request ID req_xxx or a Customer ID cus_xxx with an issue?

spare glade
#

yes , we are using the stripe payment links. We have webhooks that trigger when the payment is sucessful. Yes I do, one second

#

Customer: cus_LWjQttlXKxc8Fe , payment : pi_3OdsMOKWqxTFrzeA0ucrZ8aT.

#

You will see the payment and pening invoice item were created at the same time of Jan 29th at 10:47 am but no invoice was created

#

when I test in the sandbox I expect to see a payment and invoice record created when a payment link is used.

mild vector
#

hmm so let me explain why I'm confused

#

ah you mean the Hosted Invoice Page not PaymentLinks

#

so the issue here is what I was alluding to in the last thread

#

there's a race condition where if you create an InvoiceItem manually and then create an Invoice quickly after, we haven't saved the item yet, so the Invoice request fails and says there's no item

#

it's a common issue

#

you fix it by using the newer approach where you can create the Invoice first and then add the items to it

spare glade
#

So to fix this, do we need to regenerate all the payment links we have made in the past?

mild vector
#

no, not at all

#

alternative the fix can be to catch this "no items to invoice" error and retry the Invoice create request a few second later and retry a few times until it works, as I said it's a bit of a race condition where the item is not fully saved by the time the "create Invoice" request comes in

spare glade
#

I think the disconnect is my misunderstanding on how payment links are made in the system. How are they made?

mild vector
spare glade
mild vector
#

so it's created when an Invoice object is finalised, so you need to create an Invoice first, and what you're describing is that sometimes the Invoice creation fails, due to the race condition I'm talking about

spare glade
#

ok I think I need to speak to the customer on my side to see how they are making these links and if it is via code we need to remake them using the new method you mentioned

mild vector
#

well yes someone wrote some Node code that calls our API from your Stripe account and integrates with the Invoices API and the developer of that code can make some changes to handle this error/change the approach. Sorry, I thought you were that developer?

spare glade
#

Its ok I am not. I was told they dont have any custom work on stripe. I am just the one who made the webhooks so I can push the information to the 3rd party software which I am the developer for.

#

Thanks for the help

mild vector
#

yeah there is definitely more to your integration than just using no-code solutions, you use backend Invoicing features to create these hosted payment links, so it's more like a hybrid approach

spare glade
#

Thanks Karl , I have a lot to look into it seems