#jrfr-paymentintent-data

1 messages · Page 1 of 1 (latest)

trim prairieBOT
vocal grove
#

jrfr-paymentintent-data

#

@full nest we don't have something like this and it's partly because there's a lot of separate things to look at. We don't have a "unified view" for something like this

#

the rest lives elsewhere.
A PaymentIntent will create a Charge after each attempt, at most one successful one. And then a Charge can have 0/1/N Refunds and 0/1/N Disputes too

#

so really you need to "aggregate all of this information"

full nest
#

yeah thats the crux of the issue

#

so a more concrete example a 3rd party UI would offer to customers an ability to submit evidence if a dispute is ongoing and not yet past the window for submitting evidence. This would be in the form of showing a button or not for that action

#

I was thinking I would know this state based on looking at some aspect(s) of the payment intent object.

#

How does stripe suggest that be achieved?

vocal grove
#

A PaymentIntent has latest_charge: 'ch_123' which is the id of the most recent Charge object. If this PaymentIntent has status: 'succeeded' then that Charge would have been successful.
A Charge can have 0/1/N Disputes. Each Dispute has its own API resource: https://stripe.com/docs/api/disputes/object and it has charge: 'ch_123' and payment_intent: 'pi_123'

#

So all those objects are "linked"

#

And then you can keep track of this Dispute through its lifecycle with other similar Events

full nest
#

using the dispute and evidence example: if I pull the details of a payment intent and all of its linked items for a moment in time, there isnt a way for me to conclude if the payment intent is disputed and evidence can still be submitted or if evidence can no longer be submitted?

vocal grove
#

I don't really follow the way you framed this no.

You have a Dispute, that Dispute has an id dp_123 and it also has the property evidence_details[due_by] https://stripe.com/docs/api/disputes/object#dispute_object-evidence_details-due_by which shows you a clear deadline.

If you have a PaymentIntent, you can use the List Disputes API https://stripe.com/docs/api/disputes/list to see if there are any Dispute(s) associated with it using payment_intent: 'pi_123' or charge: 'ch_123' for example and then look at the results and if any check the due by date for each one

full nest
#

ok so in the example of needing to decide if its valid to show a submit evidence button or not on a 3rd party website for a user i could pull the payment intent (and related items) and see if theres a dispute and if the evidence past due date hasnt yet past?

vocal grove
#

Kind of. Really you should be starting from the Dispute object. If you're a 3rd party website you have API access I assume via Connect as a feature and so have full API access and should be listening to Events for all those accounts and ingest the data about it

full nest
#

yeah this is a custom connect integration and just realizing at any point stripe or us could be down and so missed webhooks

vocal grove
#

If you use Custom Connect, you should be using Destination Charges and all those details live in the platform

full nest
#

and so it would seem still at any point in time pulling the payment intent and related items should be possible to decide what actions can be performed on a payment intent by looking at various properties

#

we are

vocal grove
#

So really you would have a WebhookEndpoint configured to listen to the relevant Events on your own account

full nest
#

you agree a 3rd party will need to show/hide different actions to users based on the state of the payment intent?

vocal grove
#

we retry Events for up to 3 days so unless you went fully down for 3 days this is a none issue

#

Again no, I would never rely on the state of the PaymentIntent for this

full nest
#

payment intent and its linked items

vocal grove
#

I mean still I would look at Disputes data from the Disputes API not from the PaymentIntent API

trim prairieBOT
full nest
#

yeah was really just saying that at some point in time id like to pull everything around a payment intent and its linked items and whatever that api is

#

and be able to say heres where the state of the item is, and as a result these are the various actions that are allowed

#

sort of how on the stripe dashboard for a payment intent theres a single status at the top "Disputed" , "Awaiting Evidence" "Dispute Lost" etc

#

that would be a very useful thing to have on a remote 3rd party site as well

vocal grove
#

yeah but really I'd never "pull" that info

#

I'd use webhooks so that I'd aggregate the data based on the Events I have received

full nest
#

yeah ok I just wanted to see what the guidance was on looking at the state of the payment intent and related items

#

it seems to me like there is enough information if forced to pull all that info at apoint in time to know the state of the overall item and what actions are valid

vocal grove
#

yes

#

it's just inefficient if you do this every time you load a PaymentIntent

#

but overall you're right, the data exists and can be pulled at will

full nest
#

yeah understood the performance implications was just wondering how stripe was advising how customers are meant to coordinate their own state machine