#blackgriffen237
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Not sure I completely follow the ask here. Can you share an example that you're looking at so that we're on the same page?
umm do you want the JSON response or what?
im using java
it has a status
getStatus could be successful
if that is so there is also a getAmountReceived for a PaymentIntent that was a charge
thats what i do, a PaymentIntent with a charge
an then there is a charge id and a charge object
getLatestChargeObject()
and that has a bunch of info in it too
so what im asking is if you have to evaluate that as well to be sure the charge is "good"
ok this is test mode is that a problem?
No, that should be fine.
pi_3MBqLCC8CmvaZfLJ1mD1ZlhP
it has amount 500
and status succeeded
but it has lots of other stuff
right, so what's your end goal here?
im going to add the paymentIntent's amount to the users account
and i want to be sure it went through
so what im asking is if the paymentintent has Amount, if the status is "succeeded" then the amount is valid ? or do i have to check other things
im sorry if i am being confusing
Gotcha. So instead of polling the API and looking at the status, what you want is to build a webhook endpoint.
https://stripe.com/docs/webhooks
This allows you to receive events when things happen with the Payment.
For example, You'd receive an event payment_intent.succeeded on your server once it succeeds rather than you polling the API to retrieve its status
well im already doing that
and i am getting the payment intent on the event payment_intent.succeeded, but its a big JSON object with lots of information
Ah okay, then that should be enough to tell if the payment was successful
Typically folks rely on just the status but you can also double check the amount if you find that necessary
ok, maybe let me ask another way
is there a test card that will generate a payment_intent.succeeded event but the charge didnt go through, like i wanted 1000 USD but the charge didnt go through
or something
i just want to avoid making a dumb mistake if someone is a bad actor or makes a normal mistake but i take the hit
or are you saying that IFF i get payment_intent.succeeded the card is good, the charge is good, all is good
or are you saying that IFF i get payment_intent.succeeded the card is good, the charge is good, all is good
Yup
NP! ๐ Glad I could help