#simon_api
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/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.
- simon_api, 2 days ago, 17 messages
Hi there, sorry for the delay!
Hello
Hi, can you explain what you're trying to accomplish specifically? Can you share the integration document you're using?
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
The API update that I mentioned earlier was to bring me to 2024-09-30.acacia but I don't see any changes related to the tax processing in the ChangeLog https://docs.stripe.com/upgrades#2024-09-30.acacia
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)
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
Can you share a specific request id with me?
Similar to the above, I need a req_ for when this worked.
I have the requets id for it failed, req_0ipls0OPuBmsTV. I need one that worked just 2 days ago
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?
Let me look
or the same calculation is returned when I execute tax.create.calculation
Hmm, I do not think it's the API version. You first make this request, https://dashboard.stripe.com/test/logs/req_uoKg3FvXK5Dwar at
2024-10-04 18:22:28 UTC and it returned tax_1Q6G91ApMkaZmFOdhFax7aOk. Then, at
2024-10-04 18:23:30 UTC a seconds later, you made another request, https://dashboard.stripe.com/test/logs/req_0ipls0OPuBmsTV which it is erroring because you already created a tax transaction.
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?
I have just retried the experiment without creating the tax transaction, but in the logs I can see it has been created req_ZGpHFuEfBfvI1c
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?
I guess I know the reason...
yeap, that is working as expected now.
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
Ah, glad you were able to get to the bottom of this and things are working as expected.
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
Ohh, I thought you said you found the root cause