#extjac-paymentintent-status

1 messages · Page 1 of 1 (latest)

clever pythonBOT
wise zenith
#

@worn patio I'm sorry I don't really follow your ask overall and what you mena exactly. What's not working? What have you tried, what's an exact example PaymentIntent where it didn't work, etc.

worn patio
#

this is an example of a payment that did not work for us.

wise zenith
#

sorry that's a picture

worn patio
#

going to explain more now....one sec

wise zenith
#

what's the exact id in text, what exact value did status have, what have you logged, etc.

#

extjac-paymentintent-status

worn patio
#

so we process online payments. We just switched from Stripe Charge to Stripe PaymentInten. With charge, we can the the reponse right away and see the payment status when succeeded.

#

so with Charge when the payment status is succeeded we confirm the order and insert a payment record.

#

we are trying to do the same with PaymentIntent.

wise zenith
#

yeah you mostly can't

worn patio
#

so after the customer confirm the payment intent, we re direct them to a page where we check the paymentIntentn status

wise zenith
#

okay sorry please pause

#

Try and write one clear summary in one clear complete message instead of short sentences. That way I can see the full explanation/question once you are ready!

worn patio
#

ok ...one min then.

#

"Our team is developing a project using PHP and has recently transitioned from using Stripe's Charge API to the Stripe Payment Intent API. Previously, with Stripe Charge, we could instantly receive a 'succeeded' payment status, allowing us to confirm and record the transaction immediately. However, with the new Stripe Payment Intent, the process is different.

Now, after a customer completes their payment information, triggering the Payment Intent, they're redirected to a specific page. On this page, we verify the status of the Payment Intent. If the status is 'succeeded', 'processing', 'requires_source_action', or 'requires_action', we proceed to confirm the order and log the payment along with its current status.

We're facing an issue where some orders aren't getting confirmed, and their payments aren't being recorded, even though Stripe shows the payment as 'succeeded'. We suspect this might be due to a delay in Stripe updating the payment status to 'succeeded'. Our concern is whether there's a transitional status for the Payment Intent that we should include in our current validation process.

In our code, we have an if statement that checks if the payment intent's status is set and matches any of the following: 'requires_action', 'requires_source_action', 'processing', or 'succeeded'. If it does, we confirm the order and record the payment, even if it's pending for reasons such as ACH processing."

Let me know if this clarifies your original explanation or if you need further adjustments

wise zenith
#

Ah sorry, I understood all of that already. The real question I have is not adressed: you say it "doesn't work". So your code should be logging the value you get back for status and/or a clear PaymentIntent id and I need that to help you

worn patio
#

is there any paymentIntent status that we should considering adding out our IF statment?

#

so we can confirm the order?

wise zenith
#

that's the wrong question to ask unfortunately

#

for example you mention requires_source_action which has been deprecated for 5 years and only affects integrations using extremely old API versions. So it feels like a mixed bag of values maybe misunderstood.

#

To debug this we need to first start with a clear example of something not working with its exact value at the time so that I can help you understand what happened

worn patio
#

we are using requires_source_action because one customer has a very old stripe account.

wise zenith
#

sure but your own code should be using one specific API version and not "the API version of the customer's account". And so that should never matter

worn patio
#

can you explaing this to me please?

#

what do the timestamp mean here?

wise zenith
#

it's again a picture

#

I'm a developer, I need real text like real ids so I can look it up

worn patio
#

do you see the timestamp?

wise zenith
#

no I don't. To me a timestamp is an integer that represents the number of seconds since a certain date. I see date times but many, and it's really unclear

worn patio
#

why is the paument intent creatin and completed have such a long time differnce?

wise zenith
#

Really sorry but please try to talk developer to developer, focused on code or what the exact API layer looks like

worn patio
#

but as i said, our code seems to be fine. It works 99% of the time.

we use the return_url to redict the customers after the payment is confirmed.

    const {error, paymentIntent} = await stripe.confirmPayment({
        elements,
        confirmParams: { return_url }
    });

then on this return url we validate the $request->payment_intent .

if the $request->payment_intent is valid, we listen for the status.

if the status....

    if( isset($paymentIntent->status) AND ($paymentIntent->status=='requires_action' OR $paymentIntent->status=='requires_source_action' OR $paymentIntent->status=='processing' OR $paymentIntent->status=='succeeded' ) ) {

}

we confirm the order.

wise zenith
#

I'm really sorry, you're a bit all over the place right now 😦

#

You seem to be asking "why did it take so long for the PaymentIntent to complete" from your pictures. Is that your real question when you said "the timestamp"? A PaymentIntent is a state machine that goes through state changes through various cases like confirming a PaymentIntent.
From that picture it looks like you created the PaymentIntent at a certain time (11:41 am) and then hours later the end customer did complete the payment (7:58 pm). That's something that would happen on your end based on when you showed the payment method collection UI (you didn't share any details about what of our numerous products you use) and when the real confirmation with card details (or other payment methods) happened

#

Right now I'm mostly guessing because of the lack of information. As the developer of that application you should be able to look at the PaymentIntent in the Dashboard or the API, see its status, what payment method type was used, look at Events to see when the status changed, etc.

worn patio
#

the questions i would like an answer if possible...

  1. will stripe return "succeeded" status right away when processing credit cards (assuring the card info is correct)

  2. if the "succeeded" status take 10 seconds or 10 hours, ...is there any status like "capture" or anyting like that will be set as temproary in the paymentIntent?

wise zenith
#
  1. will stripe return "succeeded" status right away when processing credit cards (assuring the card info is correct)
    If the payment succeeded and the redirect you implemented happens after the PaymentIntent is confirmed successfully then yes.
worn patio
#

this is why i show you the picture from the stripe logs. Because it seems that is not the case.

Is "completed" a valid status?

wise zenith
#

I'm sorry but that picture doesn't prove anything different. I explained in details in words what it meant above already. Make sure to carefully read that.
And no "completed" is not a valid status. All our valid status values are in our API reference: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status (except the ones we changed in API version but it's a real implementation bug if your own code does not pin to a specific API version)

worn patio
#

thank you for your help. I will continue on my own. you can close this capture.

#

thread

wise zenith
#

sounds good, sorry I couldn't help more