mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-12-08 00:01:02 -05:00
* Bump Rubocop to 0.57.2
* Style/StderrPuts: Use warn instead of .puts
* Style/ExpandPathArguments: Use expand_path('../test_helper', __dir__) instead of expand_path('../../test_helper', __FILE__)
* Style/Encoding: Unnecessary utf-8 encoding comment
* Style/StringLiterals: Prefer double-quoted strings
* Style/AccessModifierDeclarations
* Style/FormatStringToken: Prefer annotated tokens
* Naming/UncommunicativeMethodParamName
* Metrics/LineLength: set maximum line length to 100 characters
* Style/IfUnlessModifier: Favor modifier if usage when having a single-line body
* Style/ClassVars
* Metrics/LineLength: set maximum line length to 80 characters (default)
* Style/AccessModifierDeclarations: EnforcedStyle: inline
30 lines
900 B
Ruby
30 lines
900 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Stripe
|
|
class Reversal < APIResource
|
|
extend Stripe::APIOperations::List
|
|
include Stripe::APIOperations::Save
|
|
|
|
OBJECT_NAME = "transfer_reversal".freeze
|
|
|
|
def resource_url
|
|
"#{Transfer.resource_url}/#{CGI.escape(transfer)}/reversals" \
|
|
"/#{CGI.escape(id)}"
|
|
end
|
|
|
|
def self.update(_id, _params = nil, _opts = nil)
|
|
raise NotImplementedError,
|
|
"Reversals cannot be updated without a transfer ID. Update a " \
|
|
"reversal using `r = Transfer.update_reversal('transfer_id', " \
|
|
"'reversal_id', update_params)`"
|
|
end
|
|
|
|
def self.retrieve(_id, _opts = {})
|
|
raise NotImplementedError,
|
|
"Reversals cannot be retrieved without a transfer ID. Retrieve " \
|
|
"a reversal using `Transfer.retrieve_reversal('transfer_id', " \
|
|
"'reversal_id')`"
|
|
end
|
|
end
|
|
end
|