#f3ax_paymentintent-capture
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/1273687592612663357
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
@solar pier can you share an exact example so I can help you debug?
f3ax_paymentintent-capture
Hey thank you for your reply, what exactly do you need me to provide
An exact PaymentIntent id pi_123456 so I can look at what's wrong
sure, so here is a payment intent id we tried capturing yesterday and there was a partial refund.
pi_3Pn1JWK8dZuyTTEK1CNaRHIW
Here is my usage of the API in zapier:
That PaymentIntent was created with amount: 59054 and then you captured it by passing amount_to_capture: 59017
So you explicitly told us to capture less than what you authorized.
So the problem is with my calculation for the amount?
Okay if I omit passing the amount_to_capture
does that solve it?
yes if you omit the parameter it will capture the full amount
But I would recommend debugging why your calculation is off. It's pretty important to grasp why you ask for $X and then capture $Y
I am using a form to calculate the amount and then I pass it into GoHighLevel. So I will trace it and see where the problem is. For now I will remove amount_to capture
Thanks a lot for the help.
sure thing!
One more thing please
sure what's up?
When we authorized the same payment intent, was it authorised for 59054 or 59017
Because it should have been authorized for 59017
Here is the thing:
This is how I create the payment intent
I am using the same Due Now Variable from GHL
Sorry those are really just pictures.
All I can tell you is what you are sending in the API and it doesn't look like the amount you think you are passing
Understood, but it cannot be because I am using the same variable for creating the payment intent and capturing it.
We focus more on helping developers writing their own end to end code here. It looks like you're using some third-party no-code UI and I'm not sure how it works and what it does. But you are not passing the amount you think you are
Figured this would be a developer thing even if it's no code UI.
Thanks again for the help.
yeah it totally could be a developer thing, it's just not possible for me to tell you what part of the UI is wrong
I can only say what you are sending in the API. You as the developer can try to debug this on your own account, pass a certain amount and confirm it's what you end up setting on the PaymentIntent
Yeah, I will be doing that. I will run a few tests on myself and see what happens. My confusion was regarding the part that I am using a variable so I don't know how can the variable change from creating the payment intent to capturing it.
yeah that part I can't speak to, maybe your variable is changing between creation and capture and you're misunderstanding how that no-code UI works? Just a guess though
Yeah I will trace it and see.
Last question:
If I was not able to trace the change, is there a way I can tell how much a payment intent is for?
I will use Python code and calculate the difference to adjust the amount before capture.
Hi ๐
I'm stepping in as my colleague needs to go
If you have the PaymentIntent ID then yes, that would be the API you would use.
https://docs.stripe.com/api/payment_intents/retrieve
And if you are using Python we have a very useful Python library
https://github.com/stripe/stripe-python
Alright, and I would get the amount in the response body? is it in JSON so I can convert it to a dictionary and search for the key?
No need
The Stripe library will return an object so you can just do the following
pi = stripe.PaymentIntent.retrieve('pi_XXXXXXX')
print(pi.amount)
Yeah, we treat payment intent as an object, great!
Thanks a lot, guys, that will be it for now.