# File generated from our OpenAPI spec # frozen_string_literal: true module Stripe module Issuing # As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with. # # Related guide: [Issuing disputes](https://stripe.com/docs/issuing/purchases/disputes) class Dispute < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List include Stripe::APIOperations::Save OBJECT_NAME = "issuing.dispute" def self.object_name "issuing.dispute" end # Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/issuing/disputes", params: params, opts: opts ) end # Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. def self.list(filters = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/issuing/disputes", params: filters, opts: opts ) end # Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). def submit(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/issuing/disputes/%s/submit", { dispute: CGI.escape(self["id"]) }), params: params, opts: opts ) end # Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). def self.submit(dispute, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/issuing/disputes/%s/submit", { dispute: CGI.escape(dispute) }), params: params, opts: opts ) end # Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. def self.update(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/issuing/disputes/%s", { id: CGI.escape(id) }), params: params, opts: opts ) end end end end