#andrew-minion_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/1458137616300900424
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Here's the full error from attempting to partially-capture the payment intent:
"Invalid amount_details. The calculated amount is Sum(line_items[#].unit_cost * line_items[#].quantity + line_items[#].tax.total_tax_amount - line_items[#].discount_amount) + shipping.amount or Sum(line_items[#].unit_cost * line_items[#].quantity) + tax.total_tax_amount + shipping.amount - discount_amount which does not match the total amount charged. In this case the calculated amount 9189 is not equal to the total amount 1814 on the PaymentIntent."
And here's the full error from trying to remove/edit the line items:
This PaymentIntent's amount_details could not be updated because it has a status of requires_capture. You may only update the amount_details of a PaymentIntent with one of the following statuses: requires_payment_method, requires_confirmation, requires_action.
hi there, I agree that the error message is cryptic at best. I'll flag that to our internal teams. do you have a request ID for when you attempted to update the line items on that Payment Intent?
Hi there. I'll be taking over for denton, who needed to step away
just catching up and stepping through what you've done on this PaymentIntent
I think what you need to do is update the line item details in the same request as you capture, or else pass them at capture. There are a few differences between what you're trying to do and what we describe in the two applicable guides, Payment Line Items and Partial Authorization, but also if I remember correctly, this feature looks a bit different in API versions after 2025-03-31.basil and you're on an Acacia release. Give me a few minutes to test here and figure out the correct way to do this
Hmm...I thought I had tried updating them during the capture amount but will give that another try
Yeah, I reproduced what you did and in req_MvWsDCGO2e8MlX, (the first failed capture attempt), your request body is this:
amount_to_capture: "1814",
But for that request to succeed you would need something like this:
amount_to_capture: "1814",
amount_details: {
line_items: {
0: {
payment_method_options: {
card: {
commodity_code: "90121602",
},
},
product_code: "10858_visa_c",
product_name: "United Kingdom ETA",
quantity: "1",
tax: {
total_tax_amount: "0",
},
unit_cost: "1814",
unit_of_measure: "each",
},
}
}
}```
the amount you are capturing has to line up with the amount on a line item (when using line items)