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](docs.stripe.com/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with.

Related guide: [Issuing disputes](docs.stripe.com/issuing/purchases/disputes)

Defined Under Namespace

Classes: CryptoTransaction, 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

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #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](docs.stripe.com/currencies#zero-decimal). Usually the amount of the ‘transaction`, but can differ (usually because of currency fluctuation).



354
355
356
# File 'lib/stripe/resources/issuing/dispute.rb', line 354

def amount
  @amount
end

#balance_transactionsObject (readonly)

List of balance transactions associated with the dispute.



356
357
358
# File 'lib/stripe/resources/issuing/dispute.rb', line 356

def balance_transactions
  @balance_transactions
end

#createdObject (readonly)

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



358
359
360
# File 'lib/stripe/resources/issuing/dispute.rb', line 358

def created
  @created
end

#crypto_transactionsObject (readonly)

Array of onchain crypto transactions linked to this resource.



360
361
362
# File 'lib/stripe/resources/issuing/dispute.rb', line 360

def crypto_transactions
  @crypto_transactions
end

#currencyObject (readonly)

The currency the ‘transaction` was made in.



362
363
364
# File 'lib/stripe/resources/issuing/dispute.rb', line 362

def currency
  @currency
end

#evidenceObject (readonly)

Attribute for field evidence



364
365
366
# File 'lib/stripe/resources/issuing/dispute.rb', line 364

def evidence
  @evidence
end

#idObject (readonly)

Unique identifier for the object.



366
367
368
# File 'lib/stripe/resources/issuing/dispute.rb', line 366

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.



368
369
370
# File 'lib/stripe/resources/issuing/dispute.rb', line 368

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.



370
371
372
# File 'lib/stripe/resources/issuing/dispute.rb', line 370

def loss_reason
  @loss_reason
end

#metadataObject (readonly)

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



372
373
374
# File 'lib/stripe/resources/issuing/dispute.rb', line 372

def 
  @metadata
end

#objectObject (readonly)

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



374
375
376
# File 'lib/stripe/resources/issuing/dispute.rb', line 374

def object
  @object
end

#statusObject (readonly)

Current status of the dispute.



376
377
378
# File 'lib/stripe/resources/issuing/dispute.rb', line 376

def status
  @status
end

#transactionObject (readonly)

The transaction being disputed.



378
379
380
# File 'lib/stripe/resources/issuing/dispute.rb', line 378

def transaction
  @transaction
end

#treasuryObject (readonly)

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



380
381
382
# File 'lib/stripe/resources/issuing/dispute.rb', line 380

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



383
384
385
386
387
388
389
390
# File 'lib/stripe/resources/issuing/dispute.rb', line 383

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

.field_remappingsObject



440
441
442
# File 'lib/stripe/resources/issuing/dispute.rb', line 440

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



432
433
434
435
436
437
438
# File 'lib/stripe/resources/issuing/dispute.rb', line 432

def self.inner_class_types
  @inner_class_types = {
    crypto_transactions: CryptoTransaction,
    evidence: Evidence,
    treasury: Treasury,
  }
end

.list(params = {}, 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.



393
394
395
396
397
398
399
400
# File 'lib/stripe/resources/issuing/dispute.rb', line 393

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/issuing/disputes",
    params: params,
    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](docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).



413
414
415
416
417
418
419
420
# File 'lib/stripe/resources/issuing/dispute.rb', line 413

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(dispute, 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.



423
424
425
426
427
428
429
430
# File 'lib/stripe/resources/issuing/dispute.rb', line 423

def self.update(dispute, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/disputes/%<dispute>s", { dispute: CGI.escape(dispute) }),
    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](docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).



403
404
405
406
407
408
409
410
# File 'lib/stripe/resources/issuing/dispute.rb', line 403

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