Class: Stripe::Treasury::CreditReversal

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Defined in:
lib/stripe/resources/treasury/credit_reversal.rb

Overview

You can reverse some [ReceivedCredits](stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.

Defined Under Namespace

Classes: StatusTransitions

Constant Summary collapse

OBJECT_NAME =
"treasury.credit_reversal"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

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

Instance Attribute Details

#amountObject (readonly)

Amount (in cents) transferred.



20
21
22
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 20

def amount
  @amount
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



22
23
24
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 22

def created
  @created
end

#currencyObject (readonly)

Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).



24
25
26
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 24

def currency
  @currency
end

#financial_accountObject (readonly)

The FinancialAccount to reverse funds from.



26
27
28
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 26

def 
  @financial_account
end

#hosted_regulatory_receipt_urlObject (readonly)

A [hosted transaction receipt](stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe’s money transmission licenses.



28
29
30
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 28

def hosted_regulatory_receipt_url
  @hosted_regulatory_receipt_url
end

#idObject (readonly)

Unique identifier for the object.



30
31
32
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 30

def id
  @id
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



32
33
34
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 32

def livemode
  @livemode
end

#metadataObject (readonly)

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



34
35
36
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 34

def 
  @metadata
end

#networkObject (readonly)

The rails used to reverse the funds.



36
37
38
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 36

def network
  @network
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



38
39
40
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 38

def object
  @object
end

#received_creditObject (readonly)

The ReceivedCredit being reversed.



40
41
42
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 40

def received_credit
  @received_credit
end

#statusObject (readonly)

Status of the CreditReversal



42
43
44
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 42

def status
  @status
end

#status_transitionsObject (readonly)

Attribute for field status_transitions



44
45
46
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 44

def status_transitions
  @status_transitions
end

#transactionObject (readonly)

The Transaction associated with this object.



46
47
48
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 46

def transaction
  @transaction
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

Reverses a ReceivedCredit and creates a CreditReversal object.



49
50
51
52
53
54
55
56
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 49

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/treasury/credit_reversals",
    params: params,
    opts: opts
  )
end

.list(filters = {}, opts = {}) ⇒ Object

Returns a list of CreditReversals.



59
60
61
62
63
64
65
66
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 59

def self.list(filters = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/treasury/credit_reversals",
    params: filters,
    opts: opts
  )
end

.object_nameObject



12
13
14
# File 'lib/stripe/resources/treasury/credit_reversal.rb', line 12

def self.object_name
  "treasury.credit_reversal"
end