Class: Stripe::DisputeService

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

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.



9
10
11
12
13
14
15
16
17
# File 'lib/stripe/services/dispute_service.rb', line 9

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.



20
21
22
# File 'lib/stripe/services/dispute_service.rb', line 20

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.



25
26
27
28
29
30
31
32
33
# File 'lib/stripe/services/dispute_service.rb', line 25

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).



38
39
40
41
42
43
44
45
46
# File 'lib/stripe/services/dispute_service.rb', line 38

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