#vish-metadata
1 messages · Page 1 of 1 (latest)
👋 I don't think so. Metadata lives on the Dispute object, so it would have to exist before you can add metadata to it
https://stripe.com/docs/api/disputes/object#dispute_object-metadata
Yeah, you would just retrieve the Charge (using the Charge ID on the Dispute) and then update the Dispute's metadata
but can anything be set on the charge so that when a dispute is created for the charge then metadata is auto assigned to the dispute?
No, you would have to code that on your end
While testing, is there a way to raise disputes later after the charge goes through?
Would like to simulate real world scenarios
Disputes only ever occur after a charge is created anyway, so that's a good place to start!
You can only create them via Stripe CLI: https://stripe.com/docs/cli/trigger#trigger-event-charge_dispute_created
No but like 3 days after charge is created
Yup! Your customers can't dispute a transaction unless it results in money-movement and they have up to 60 days to do it (in the US)
Ah, I forgot you can also use specific test card numbers to simulate Disputes in testmode, so these would occur immediately after charge creation. That being said, the CLI solution I mentioned above should work just fine for initiating a test dispute up to 60 days later
So if I would like to create a dispute 3 days after the charge, Stripe CLI is the only way?
Yup
Can there be multiple disputes related to a charge?
And in webhooks, can I always expect the charge.dispute.created be called after charge.succeeded?
And if a dispute is created later, will charge.updated be called on webhooks?
^ 3 questions
Can there be multiple disputes related to a charge?
Only one Dispute per charge as far as I know
And in webhooks, can I always expect the charge.dispute.created be called after charge.succeeded?
This event would always trigger once a Dispute is created
And if a dispute is created later, will charge.updated be called on webhooks?
This is the same answer as above. This webhook event will fire everytime a Dispute is created
Thanks regarding the first question
Regarding the second question, I know that charge.dispute.created is always triggered when dispute is created but let's say a dispute is created right when a charge is created. Can I safely assume that charge.dispute.created will be created after charge.succeeded is created?
Regarding third question, will charge.updated fire everytime dispute is created? I know charge.dispute.created will be fired everytime
Can I safely assume that charge.dispute.created will be created after charge.succeeded is created?
we don't guarantee event ordering, so no you can't. But in practice it's impossible for a dispute to happen exactly when a charge is created. The cardholder has to go to their bank to dispute this and it takes a while
will charge.updated fire everytime dispute is created? I know charge.dispute.created will be fired everytime
Just rely oncharge.dispute.created, you shouldn't rely oncharge.updatedat all in this flow
Alright thanks
There is a parameter in charge called disputed. Can I expect it to turn true whenever a dispute is raised?
yes
you can test all of this in a few seconds in Test mode: https://stripe.com/docs/testing#disputes
thanks
How can I create a dispute on an existing charge?
I am trying this but does not seem to work
stripe trigger charge.dispute.created --add charge=ch_3KvUd9QfWrSDultJ16VTckSR
you can't
no you can't that won't work
So how can I simulate the real world scenario of creating a dispute few days after the charge?
you can't
but it's all just test mode, so it shouldn't really matter that Test mode creates the dispute a few seconds later, it's all the same code processing it in the end
Alright thanks
Okay sorry it took a while
I am not sure what you mean?
sorry wrong thread, my bad