#DeliveryTiem
1 messages · Page 1 of 1 (latest)
Hmm, don't believe there is. Checking
Thanks, it's a crucial piece for us
Handling edge cases that can cause side effects if not checking currently pending charges
To confirm, this is ACH Debit?
Got it, confirming
Our assumption is that the test data here will simulate a pending status briefly, before failing/succeeding: https://stripe.com/docs/payments/ach-debit#testing
Testing to check
What I am seeing is the payment is instantly marked as paid (using test acc no. 000123456789) and not pending status.
The second I click 'pay' on our frontend I immediately refresh the payment list on the Stripe dashboard and it is marked as paid
You should receive a payment_intent.processing webhook event (which is generally what we'd recommend for async/delayed payment methods rather than handling them synchronously)
So I guess it depends on what it is you're trying to test exactly when in a pending state
So what I'm exactly testing is just checking the 'pending' property of the charge object to prevent triggering our own business logic when a charge is still in transit.
Unsure what you mean by handling the payment synchronously in comparison to async
should be totally possible, is something blocking exactly? you would get webhooks indicating all the changes to the PaymentIntent and Charge, the same way you do in live mode, it's just that the processing time is a few seconds/minutes instead of days; you'd write your code based on handling the webhooks.
So current logic is using the charge id to retrieve the charge object, then check if 'status' property value is 'pending'. Since processing time is a few seconds I can't have enough time to debug & breakpoint the 5 lines of codes I have to get charge & check the property. From @loud trench 's comment and yourself, we need to implement support for capturing & storing the 'pending' webhook event rather than retrieving the charge itself.
in general the way we expect you to build this is https://stripe.com/docs/payments/ach-debit/accept-a-payment?platform=web&ui=API#web-confirm-paymentintent-succeeded
i.e. receive payment_intent.processing event, update your database to mark the order in your system associated with that PaymentIntent as "customer payment is pending"
receive payment_intent.succeeed after, update the database to say the order is now paid
Okay cool I get the general concept, we need to do some thought to implement it this way instead. We already accept webhooks so a bit of spec work & db changes and we should be good to go