Class: Stripe::Reversal
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Reversal
- Extended by:
- APIOperations::List
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/reversal.rb
Overview
[Stripe Connect](stripe.com/docs/connect) platforms can reverse transfers made to a connected account, either entirely or partially, and can also specify whether to refund any related application fees. Transfer reversals add to the platform’s balance and subtract from the destination account’s balance.
Reversing a transfer that was made for a [destination charge](stripe.com/docs/connect/destination-charges) is allowed only up to the amount of the charge. It is possible to reverse a [transfer_group](stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) transfer only if the destination account has enough balance to cover the reversal.
Related guide: [Reversing transfers](stripe.com/docs/connect/separate-charges-and-transfers#reversing-transfers)
Constant Summary collapse
- OBJECT_NAME =
"transfer_reversal"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
Instance Method Summary collapse
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #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
Class Method Details
.retrieve(_id, _opts = {}) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/stripe/resources/reversal.rb', line 36 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 |
.update(_id, _params = nil, _opts = nil) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/stripe/resources/reversal.rb', line 29 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 |
Instance Method Details
#resource_url ⇒ Object
24 25 26 27 |
# File 'lib/stripe/resources/reversal.rb', line 24 def resource_url "#{Transfer.resource_url}/#{CGI.escape(transfer)}/reversals" \ "/#{CGI.escape(id)}" end |