Class: Stripe::DisputeService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/dispute_service.rb

Defined Under Namespace

Classes: CloseParams, ListParams, RetrieveParams, UpdateParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#close(dispute, params = {}, opts = {}) ⇒ Object

Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.

The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible.



383
384
385
386
387
388
389
390
391
# File 'lib/stripe/services/dispute_service.rb', line 383

def close(dispute, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/disputes/%<dispute>s/close", { dispute: CGI.escape(dispute) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Returns a list of your disputes.



394
395
396
# File 'lib/stripe/services/dispute_service.rb', line 394

def list(params = {}, opts = {})
  request(method: :get, path: "/v1/disputes", params: params, opts: opts, base_address: :api)
end

#retrieve(dispute, params = {}, opts = {}) ⇒ Object

Retrieves the dispute with the given ID.



399
400
401
402
403
404
405
406
407
# File 'lib/stripe/services/dispute_service.rb', line 399

def retrieve(dispute, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/disputes/%<dispute>s", { dispute: CGI.escape(dispute) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#update(dispute, params = {}, opts = {}) ⇒ Object

When you get a dispute, contacting your customer is always the best first step. If that doesn’t work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically.

Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](stripe.com/docs/disputes/categories).



412
413
414
415
416
417
418
419
420
# File 'lib/stripe/services/dispute_service.rb', line 412

def update(dispute, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/disputes/%<dispute>s", { dispute: CGI.escape(dispute) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end