#simon_api

1 messages ¡ Page 1 of 1 (latest)

tribal spindleBOT
#

👋 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/1291830084013002794

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

ripe wigeon
#

Hi there, sorry for the delay!

sleek moat
#

No problem

#

Thanks for joining

tribal spindleBOT
sleek moat
#

Hello

ruby slate
#

Hi, can you explain what you're trying to accomplish specifically? Can you share the integration document you're using?

sleek moat
#

I don't have an integration document but I will try to explain it here.

#

I create a setupIntent and let user associate payment to that intent. When intent is confirmed, I process webhook setup_intent.succeeded that is emitted in response succeeded setup intent

#

Inside that hook handler I split the "order" based on some internal data and create multiple paymentIntents

#

Each paymentIntent is associated with its own taxCalculation that is recorded (by id) in the intent's metadata

#

Then, I handle webhook payment_intent.succeeded for each succeeded paymentIntent and create a taxTransaction after extracting ID of the corresponding taxCalculation from the metadata

#

That approach worked but recently (about 2 days ago) I started noticing the error that I reported above

#

I made sure to exclude any calls to "tax transaction create from calculation" API calls (commented out)

#

Still, those calculation seem to be invalid for creating tax transactions

#

I recall "upgrading" the API in stripe also a few days ago, but I'm not sure if that is related to my problem

#

My implementation is under heavy development and I change many things, but I clearly recall that the part where I create taxTransaction from taxCalculation worked before

#

Would it be possible for me to roll back to 2024-06-20 where I believe the issue with tax transaction creation was not showing up?

#

(just for the sake of experiment)

ruby slate
#

Taking a look here

#

Can you share an example request where it worked just 2 days ago?

sleek moat
#

same request, I didn't change the part where request is made

#
const taxTransaction = await stripe.tax.transactions.createFromCalculation({
  calculation: paymentIntent.metadata.tax_calculation,
  reference: `paymentIntent(${paymentIntent.id})`,
  metadata: {
    tax_calculation: paymentIntent.metadata.tax_calculation,
    payment_intent: paymentIntent.id
  }
})
#

currently I have this lines commented out and in my entire codebase there is no single line that would run stripe.tax.transactions.createFromCalculation

#

yet, when I print (log) paymentIntent.metadata.tax_calculation and try it in API Explorer I see that error

#

I can redo the experiment and share with you a taxCalculation ID that was created but never used for anything

ruby slate
#

Can you share a specific request id with me?

#

Similar to the above, I need a req_ for when this worked.

sleek moat
#

one sec

#

do you need a req_ after it failed?

ruby slate
#

I have the requets id for it failed, req_0ipls0OPuBmsTV. I need one that worked just 2 days ago

sleek moat
#

Let me try to find it...

#

I see strange data in the logs dashboard.stripe.com/test/workbench/logs when I filter based on API endpoint

#

I see my failed requests like this one req_0ipls0OPuBmsTV

#

but immediately before it I can see a successful request for the same taxCalculation like req_uoKg3FvXK5Dwar which I didn't do in my codebase...

#

strangely, these two requests have different API version: 2024-06-20 for the one that worked, and 2024-09-30.acacia for the one that failed

#

is there a possibility that tax transaction is requested automatically when I just create a calculation?

ruby slate
#

Let me look

sleek moat
#

or the same calculation is returned when I execute tax.create.calculation

ruby slate
#

Both of these requests are coming from your end. On the first request, you explicitely pass an older API version. Then, on the second request, it uses your default API version.

#

Can you debug your code to see why you're creating there two separate requests?

sleek moat
#

I have just retried the experiment without creating the tax transaction, but in the logs I can see it has been created req_ZGpHFuEfBfvI1c

ruby slate
#

Could it be possible that you added another line of code while migrating to the newere API version while testing and never took it out?

sleek moat
#

I guess I know the reason...

ruby slate
#

yeap, that is working as expected now.

sleek moat
#

It is likely caused by the deployed version of the code that is outdated but still responds to the webhooks

#

so one same webhook event is processed by my locally running server and by the deployed server

ruby slate
#

Ah, glad you were able to get to the bottom of this and things are working as expected.

sleek moat
#

they don't, as I still have those lines of the code that call tax transaction. creation commented out...

#

so the request that I have just shared was not created by my local server which I am working with, but instead by the deployed dev server

#

they both share the same api key

ruby slate
#

Ohh, I thought you said you found the root cause

sleek moat
#

no worries, I guess I have a new direction to dig

#

thank you for helping me eliminate the wrong path