Class: Stripe::Issuing::Dispute

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Includes:
APIOperations::Save
Defined in:
lib/stripe/resources/issuing/dispute.rb

Overview

As a [card issuer](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](stripe.com/docs/issuing/purchases/disputes)

Defined Under Namespace

Classes: Evidence, Treasury

Constant Summary collapse

OBJECT_NAME =
"issuing.dispute"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Instance Attribute Details

#amountObject (readonly)

Disputed amount in the card’s currency and in the [smallest currency unit](stripe.com/docs/currencies#zero-decimal). Usually the amount of the ‘transaction`, but can differ (usually because of currency fluctuation).



58
59
60
# File 'lib/stripe/resources/issuing/dispute.rb', line 58

def amount
  @amount
end

#balance_transactionsObject (readonly)

List of balance transactions associated with the dispute.



60
61
62
# File 'lib/stripe/resources/issuing/dispute.rb', line 60

def balance_transactions
  @balance_transactions
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



62
63
64
# File 'lib/stripe/resources/issuing/dispute.rb', line 62

def created
  @created
end

#currencyObject (readonly)

The currency the ‘transaction` was made in.



64
65
66
# File 'lib/stripe/resources/issuing/dispute.rb', line 64

def currency
  @currency
end

#evidenceObject (readonly)

Attribute for field evidence



66
67
68
# File 'lib/stripe/resources/issuing/dispute.rb', line 66

def evidence
  @evidence
end

#idObject (readonly)

Unique identifier for the object.



68
69
70
# File 'lib/stripe/resources/issuing/dispute.rb', line 68

def id
  @id
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



70
71
72
# File 'lib/stripe/resources/issuing/dispute.rb', line 70

def livemode
  @livemode
end

#loss_reasonObject (readonly)

The enum that describes the dispute loss outcome. If the dispute is not lost, this field will be absent. New enum values may be added in the future, so be sure to handle unknown values.



72
73
74
# File 'lib/stripe/resources/issuing/dispute.rb', line 72

def loss_reason
  @loss_reason
end

#metadataObject (readonly)

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



74
75
76
# File 'lib/stripe/resources/issuing/dispute.rb', line 74

def 
  @metadata
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



76
77
78
# File 'lib/stripe/resources/issuing/dispute.rb', line 76

def object
  @object
end

#statusObject (readonly)

Current status of the dispute.



78
79
80
# File 'lib/stripe/resources/issuing/dispute.rb', line 78

def status
  @status
end

#transactionObject (readonly)

The transaction being disputed.



80
81
82
# File 'lib/stripe/resources/issuing/dispute.rb', line 80

def transaction
  @transaction
end

#treasuryObject (readonly)

[Treasury](stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts



82
83
84
# File 'lib/stripe/resources/issuing/dispute.rb', line 82

def treasury
  @treasury
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

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](stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.



85
86
87
88
89
90
91
92
# File 'lib/stripe/resources/issuing/dispute.rb', line 85

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/issuing/disputes",
    params: params,
    opts: opts
  )
end

.list(filters = {}, opts = {}) ⇒ Object

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.



95
96
97
98
99
100
101
102
# File 'lib/stripe/resources/issuing/dispute.rb', line 95

def self.list(filters = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/issuing/disputes",
    params: filters,
    opts: opts
  )
end

.object_nameObject



15
16
17
# File 'lib/stripe/resources/issuing/dispute.rb', line 15

def self.object_name
  "issuing.dispute"
end

.submit(dispute, params = {}, opts = {}) ⇒ Object

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](stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).



115
116
117
118
119
120
121
122
# File 'lib/stripe/resources/issuing/dispute.rb', line 115

def self.submit(dispute, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/disputes/%<dispute>s/submit", { dispute: CGI.escape(dispute) }),
    params: params,
    opts: opts
  )
end

.update(id, params = {}, opts = {}) ⇒ Object

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.



125
126
127
128
129
130
131
132
# File 'lib/stripe/resources/issuing/dispute.rb', line 125

def self.update(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/disputes/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#submit(params = {}, opts = {}) ⇒ Object

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](stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).



105
106
107
108
109
110
111
112
# File 'lib/stripe/resources/issuing/dispute.rb', line 105

def submit(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/disputes/%<dispute>s/submit", { dispute: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end