Class: Stripe::DisputeService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::DisputeService
- Defined in:
- lib/stripe/services/dispute_service.rb
Instance Method Summary collapse
-
#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.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of your disputes.
-
#retrieve(dispute, params = {}, opts = {}) ⇒ Object
Retrieves the dispute with the given ID.
-
#serialize_batch_close(dispute, params = {}, opts = {}) ⇒ Object
Serializes a Dispute close request into a batch job JSONL line.
-
#update(dispute, params = {}, opts = {}) ⇒ Object
When you get a dispute, contacting your customer is always the best first step.
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 |
#serialize_batch_close(dispute, params = {}, opts = {}) ⇒ Object
Serializes a Dispute close request into a batch job JSONL line.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/stripe/services/dispute_service.rb', line 36 def serialize_batch_close(dispute, params = {}, opts = {}) request_id = SecureRandom.uuid stripe_version = opts[:stripe_version] || Stripe.api_version request_body = { id: request_id, params: params, stripe_version: stripe_version, } request_body[:path_params] = { dispute: dispute } request_body[:context] = opts[:stripe_context] if opts[:stripe_context] JSON.generate(request_body) 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](docs.stripe.com/docs/disputes/categories).
53 54 55 56 57 58 59 60 61 |
# File 'lib/stripe/services/dispute_service.rb', line 53 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 |