Class: Stripe::Reserve::Hold

Inherits:
APIResource show all
Extended by:
APIOperations::List
Defined in:
lib/stripe/resources/reserve/hold.rb

Overview

ReserveHolds are used to place a temporary ReserveHold on a merchant’s funds.

Defined Under Namespace

Classes: ReleaseDetail, ReleaseSchedule

Constant Summary collapse

OBJECT_NAME =
"reserve.hold"

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::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

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #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 reserved. A positive integer representing how much is reserved in the [smallest currency unit](docs.stripe.com/currencies#zero-decimal).



45
46
47
# File 'lib/stripe/resources/reserve/hold.rb', line 45

def amount
  @amount
end

#amount_releasableObject (readonly)

Amount in cents that can be released from this ReserveHold



47
48
49
# File 'lib/stripe/resources/reserve/hold.rb', line 47

def amount_releasable
  @amount_releasable
end

#createdObject (readonly)

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



49
50
51
# File 'lib/stripe/resources/reserve/hold.rb', line 49

def created
  @created
end

#created_byObject (readonly)

Indicates which party created this ReserveHold.



51
52
53
# File 'lib/stripe/resources/reserve/hold.rb', line 51

def created_by
  @created_by
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).



53
54
55
# File 'lib/stripe/resources/reserve/hold.rb', line 53

def currency
  @currency
end

#idObject (readonly)

Unique identifier for the object.



55
56
57
# File 'lib/stripe/resources/reserve/hold.rb', line 55

def id
  @id
end

#is_releasableObject (readonly)

Whether there are any funds available to release on this ReserveHold. Note that if the ReserveHold is in the process of being released, this could be false, even though the funds haven’t been fully released yet.



57
58
59
# File 'lib/stripe/resources/reserve/hold.rb', line 57

def is_releasable
  @is_releasable
end

#livemodeObject (readonly)

If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.



59
60
61
# File 'lib/stripe/resources/reserve/hold.rb', line 59

def livemode
  @livemode
end

#metadataObject (readonly)

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



61
62
63
# File 'lib/stripe/resources/reserve/hold.rb', line 61

def 
  @metadata
end

#objectObject (readonly)

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



63
64
65
# File 'lib/stripe/resources/reserve/hold.rb', line 63

def object
  @object
end

#reasonObject (readonly)

The reason for the ReserveHold.



65
66
67
# File 'lib/stripe/resources/reserve/hold.rb', line 65

def reason
  @reason
end

#release_detailsObject (readonly)

List of ReserveReleases and the amounts released from this ReserveHold.



67
68
69
# File 'lib/stripe/resources/reserve/hold.rb', line 67

def release_details
  @release_details
end

#release_scheduleObject (readonly)

Attribute for field release_schedule



69
70
71
# File 'lib/stripe/resources/reserve/hold.rb', line 69

def release_schedule
  @release_schedule
end

#reserve_planObject (readonly)

The ReservePlan which produced this ReserveHold (i.e., resplan_123)



71
72
73
# File 'lib/stripe/resources/reserve/hold.rb', line 71

def reserve_plan
  @reserve_plan
end

#source_chargeObject (readonly)

The Charge which funded this ReserveHold (e.g., ch_123)



73
74
75
# File 'lib/stripe/resources/reserve/hold.rb', line 73

def source_charge
  @source_charge
end

#source_typeObject (readonly)

Which source balance type this ReserveHold reserves funds from. One of ‘bank_account`, `card`, or `fpx`.



75
76
77
# File 'lib/stripe/resources/reserve/hold.rb', line 75

def source_type
  @source_type
end

Class Method Details

.field_remappingsObject



86
87
88
# File 'lib/stripe/resources/reserve/hold.rb', line 86

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



82
83
84
# File 'lib/stripe/resources/reserve/hold.rb', line 82

def self.inner_class_types
  @inner_class_types = { release_details: ReleaseDetail, release_schedule: ReleaseSchedule }
end

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

Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted order, with the most recent ReserveHolds appearing first.



78
79
80
# File 'lib/stripe/resources/reserve/hold.rb', line 78

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

.object_nameObject



11
12
13
# File 'lib/stripe/resources/reserve/hold.rb', line 11

def self.object_name
  "reserve.hold"
end